954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Trying to solve this problem but have no idea where to start...need alot of help!!

Write a C++ program that reads in the historical average monthly rainfall for NY for each month of the year and then reads in the actual monthly rainfall for each month in 2007. Finally, the program should print out a nicely formatted table showing the average rainfall for each month, the total rainfall for each month of 2007, and how much above or below average the rainfall was for each month. The output should correctly label the months.

Your program should give the user the option of entering all data from the command line or reading the data from directly from two files. Data files for this problem can be downloaded using the following commands:


There are a various ways of dealing with the month names. One straightforward way is to code the months as integers and then do a conversion before doing output. A large switch statement is acceptable in an output function. The month-by-month input for manual data entry can be done any way you like, so long as it is relatively easy and pleasant for the user.

Be sure to make good use of functions in your program. At a minimum, you should include separate functions for each input method and for generating the results. You may also decide to create a function for outputting the month names.

piznut25
Newbie Poster
6 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

I am a beginner and our teacher gave me this assignment. I am going to be writing some code tonight but I am having a tough time starting. should I have a seperate function to handle both manual and file input parts?

piznut25
Newbie Poster
6 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
 
I am a beginner and our teacher gave me this assignment. I am going to be writing some code tonight but I am having a tough time starting. should I have a seperate function to handle both manual and file input parts?
At a minimum, you should include separate functions for each input method and for generating the results

I would say yes from this description. Separate the problem into separate parts and tackle them separately. Tackle the ones you know how to do first, then start researching the rest. Don't just start coding. You need to decide what you need first on paper. It will make life much easier.

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

Okay thank you, can I post some code here to get some help from it after I start?

piznut25
Newbie Poster
6 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
 
Okay thank you, can I post some code here to get some help from it after I start?

Yes, post it. It makes it much easier to help you if we see the code.

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You