C++ Program We want to track weather conditions during the past year\'s three-mo
ID: 3675043 • Letter: C
Question
C++ Program
We want to track weather conditions during the past year's three-month summer season as has designated each day as either rainy ('R'), cloudy ('C'), or sunny ('S').
Write a program that stores this information in s 3x30 array of characters, where the row indicates the month and the column indicates the day of the month. Note no data is being captured for the 31st of any month.
This program will read the data in from a file called RainOrShine.txt. From this data it you should create a report that displays , for each month and for the whole three month period, how many days were rainy, how many were cloudy, and how many were sunny. It should also report which of the months had the largest number of rainy days.
The rain or shine text has the following information:
R C R S R S R R S R S C R C S S S S R S C S R C S S C C R S
C R R R S R S R C S R C R S S S R S C R R S C C S C S C R R
C R C C S C C R R R S S S C R C C C R C R S S S R S C R R C
The output should look like this:
Explanation / Answer
#include #include using namespace std; int main() { const int NUM_MONTHS = 3; const int NUM_DAYS = 30; const int NUM_TYPES= 3; char forecast[NUM_MONTHS][NUM_DAYS]; int counts [NUM_MONTHS][NUM_TYPES]; int rainyDays = 0; ifstream datafile; datafile.open("RainOrShine.txt"); if (!datafile) coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.