1. Average Rainfall
    Write a program that uses nested loops to collect data and calculate the average rainfall over a period of
    years. The program should first ask for the number of years. The outer loop will iterate once for each
    year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will
    ask the user for the inches of rainfall for that month. After all the iterations, the program should display
    the number of months, the total inches of rainfall, and the average rainfall per month for the entire
    period. Hint, remember the requirement to align on decimal places and no more than two decimal
    places.
    Ask the user if he wants to add another month. Make it easy on yourself, no more than two years’
    worth of data. Yes, this problem requires error conditions, e.g. the user inputs a letter instead of a
    number. You must handle all those!
  2. Paint Job Estimator
    A painting company has determined that for every 112 square feet of wall space, one gallon of paint and
    eight hours of labor will be required. The company charges $35.00 per hour for labor. Write a program
    that asks the user to enter the square feet of wall space to be painted and the price of the paint per
    gallon.
    The program should display the following data:
    • Number of gallons of paint required rounded to the next full gallon.
    • Hours of labor required
    • Cost of the paint
    • Labor charges
    • Total cost of the paint job
    • All of this will be done in a function.
    • You will ask the user for square feet of wall and price per gallon of paint.
    • You will print out in NICE FORMAT (aligned decimal points) the costs AND additionally write it to
    a file. You can decide on the name of the output file. Create the file ahead of time; and yes, you
    can assume the file exists. You don’t need to check.
    • You will ask the user if they want to rerun the program with different costs.
    • I DO NOT want to see magic numbers.
    • You will not use Global Constants.
    • You will pass all the parameters to your function(s).
    COSC 1336  3  Exam 2 Programming
  3. Golf Scores
    The Springfork Amateur Golf Club has a tournament every weekend. The club president has asked you
    to write two programs:
    • A program that will read each player’s name and golf score as keyboard input, then save these
    as records in a file named golf.txt. (Each record will have a field for the player’s name and a field
    for the player’s score.)
    • A separate program that reads the records from the golf.txt file and displays them.
    • To ease this, you can assume all names of golfers are two words only: a first name and a second
    name. For example, Arnold Palmer would be the name. There are no three word names, no Jr.,
    or the like.
    • Don’t forget all the extra stuff you have to add, like how do you stop asking for input from the
    keyboard? You have to think about this.
    Hey YOU! This is a glorified homework problem. Do not go crazy on it. All I am asking for is to write to a
    file and then read from the file. You can assume all the files exist. Consider this a gift of the gods for the
    Homework from Hell.
  4. Random Number Guessing Game
    Write a program that generates a random number in a range from 1 to 100, and asks the user to guess
    what the number is. If the user’s guess is higher than the random number, the program should display
    “Too high, try again.” If the user’s guess is lower than the random number, the program should display
    “Too low, try again.” If the user guesses the number, the application should congratulate the user and
    generate a new random number so the game can start again.
    Ask the user if he wants to play again.
    Keep count of the number of guesses that the user makes. When the user correctly guesses the random
    number, the program should display the numbe

Instructions

Here is your Exam 2 Programming, At Home Part. You can start the exam now. It is due NLT Sunday,
7/18/2021, 6 PM. When finished, submit to me via e-mail.
Here are the rules for the exam. Note, these rules apply to all the problems and will not be repeated
specifically for each problem.
Quality Programming
• Write complete programs for each problem.
• Include the first block of comments, i.e. your name, what the program does, etc.
• Define variables.
• No magic numbers.
• In plain words, quality programming.
Y/N
• Use my function Y/N function or a similar function. I don’t want you checking for Yes/yes/Y/y
each time.
• You can assume the answer is no if the user does not specifically state yes.
Built-in Functions
• Unless told otherwise, you can use built-in functions, e.g. factorial vs. writing the code.
How do you know a function exists, it’s called Google.
• Yes, you may use your own function library.
Output
• I want to see your programs AND your output from the run. No output -> Grade = 0.
• Quality output. I want all numbers aligned on decimal points. Limit the precision to two
decimal places unless the problem states otherwise.
COSC 1336  2  Exam 2 Programming
Exam Problems
Warning!!!! Some of these problems appear to be the same as homework problems that you have
already done or textbook problems on the Internet. Really bad assumption. I have changed the data
and the requirements. They are not the same. Don’t waste your time trying to change your homework.

  1. Average Rainfall
    Write a program that uses nested loops to collect data and calculate the average rainfall over a period of
    years. The program should first ask for the number of years. The outer loop will iterate once for each
    year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will
    ask the user for the inches of rainfall for that month. After all the iterations, the program should display
    the number of months, the total inches of rainfall, and the average rainfall per month for the entire
    period. Hint, remember the requirement to align on decimal places and no more than two decimal
    places.
    Ask the user if he wants to add another month. Make it easy on yourself, no more than two years’
    worth of data. Yes, this problem requires error conditions, e.g. the user inputs a letter instead of a
    number. You must handle all those!
  2. Paint Job Estimator
    A painting company has determined that for every 112 square feet of wall space, one gallon of paint and
    eight hours of labor will be required. The company charges $35.00 per hour for labor. Write a program
    that asks the user to enter the square feet of wall space to be painted and the price of the paint per
    gallon.
    The program should display the following data:
    • Number of gallons of paint required rounded to the next full gallon.
    • Hours of labor required
    • Cost of the paint
    • Labor charges
    • Total cost of the paint job
    • All of this will be done in a function.
    • You will ask the user for square feet of wall and price per gallon of paint.
    • You will print out in NICE FORMAT (aligned decimal points) the costs AND additionally write it to
    a file. You can decide on the name of the output file. Create the file ahead of time; and yes, you
    can assume the file exists. You don’t need to check.
    • You will ask the user if they want to rerun the program with different costs.
    • I DO NOT want to see magic numbers.
    • You will not use Global Constants.
    • You will pass all the parameters to your function(s).
    COSC 1336  3  Exam 2 Programming
  3. Golf Scores
    The Springfork Amateur Golf Club has a tournament every weekend. The club president has asked you
    to write two programs:
    • A program that will read each player’s name and golf score as keyboard input, then save these
    as records in a file named golf.txt. (Each record will have a field for the player’s name and a field
    for the player’s score.)
    • A separate program that reads the records from the golf.txt file and displays them.
    • To ease this, you can assume all names of golfers are two words only: a first name and a second
    name. For example, Arnold Palmer would be the name. There are no three word names, no Jr.,
    or the like.
    • Don’t forget all the extra stuff you have to add, like how do you stop asking for input from the
    keyboard? You have to think about this.
    Hey YOU! This is a glorified homework problem. Do not go crazy on it. All I am asking for is to write to a
    file and then read from the file. You can assume all the files exist. Consider this a gift of the gods for the
    Homework from Hell.
  4. Random Number Guessing Game
    Write a program that generates a random number in a range from 1 to 100, and asks the user to guess
    what the number is. If the user’s guess is higher than the random number, the program should display
    “Too high, try again.” If the user’s guess is lower than the random number, the program should display
    “Too low, try again.” If the user guesses the number, the application should congratulate the user and
    generate a new random number so the game can start again.
    Ask the user if he wants to play again.
    Keep count of the number of guesses that the user makes. When the user correctly guesses the random
    number, the program should display the numbe

Explain Application of Ethical Principles and Theories as They Relate to Public Health Issues and Public Health or Epidemiologic Research

Order with us today for a quality custom paper on the above topic or any other topic!

What Awaits you:

• High Quality custom-written papers

• Automatic plagiarism check

• On-time delivery guarantee

• Masters and PhD-level writers

• 100% Privacy and Confidentiality

Message 3