Write the c program that read a input file rainorshinetxt


Assignment -

Write the C++ program that read a input file RainOrShine.txt and display a three month report of rainy, sunny and cloudy statistics and the month which has most rainy days to console.

Program Plan:

  • Declare the following variables for constants
  • Set constant values for number of months number of days
  • NUM_MONTHS = 3, DAYS = 30
  • weather[NUM_MONTHS][DAYS];
  • set variables to zero numRainyDays=0,numSunnyDays=0;
  • numCloudyDays=0, totalSunny = 0,totalRain = 0,
  • totalCloudy = 0 and lrgstRain = 0
  • Read the text file RainOrShine.txt file into the array, weather.
  • Find the number of rainddays
  • Find the number of sunnyddays
  • Find the number of cloudydays
  • Find the the month of highest rainy days.
  • Display the total rainy days to console.
  • Print the month of highest rainy days to console.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write the c program that read a input file rainorshinetxt
Reference No:- TGS02894727

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)