fork download
  1. //Natalie Zarate CSC 5 Chapter 11, P.646 #4
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. // Prototype for GetWeatherInfo
  6. void GetWeatherInfo(Weather month[],int num);
  7.  
  8. // Prototype for TempValid
  9. void TempValid(Weather month[], int num);
  10.  
  11. int main()
  12. {
  13. struct Weather
  14. {
  15. float totalRain;
  16. float tempHigh;
  17. float tempLow;
  18. float temp_avg;
  19. };
  20. months = 12;
  21. Weather month[months];
  22.  
  23. // Call GetWeatherInfo
  24. GetWeatherInfo(month, months);
  25.  
  26. return 0;
  27. }
  28.  
  29. void GetWeatherInfo (Weather month[],int num )
  30. {
  31. for (int i = 0; i < num; i++)
  32. {
  33. // Prompt for total rainfall in month
  34. cout <<"Enter the total rainfall for Month " << i + 1 << ":" << endl;
  35. cin >> month[i].totalRain;
  36.  
  37. // Prompt for highest temp for month
  38. cout << "Enter highest temperature for Month " << i + 1 << ": " << endl;
  39. cin >> month[i].tempHigh;
  40.  
  41. // Call TempValid
  42. TempValid(month, num);
  43.  
  44. // Prompt user for lowest temp for month
  45. cout << "Enter lowest temperature for Month " << i + 1 << ": " << endl;
  46. cin >> month[i].tempLow;
  47.  
  48. // Prompt user for average temperature for month
  49. cout << "Enter average temperture for Month " << i + 1 << ": " << endl;
  50. cin >> month[i].temp_avg;
  51. }
  52. }
  53.  
  54. void TempValid(Weather month[], int num)
  55. {
  56.  
  57. if ()
  58. }
Success #stdin #stdout 0s 5252KB
stdin
stdout
Standard output is empty