Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a flow chart using visual logic to represent the logic of a program that

ID: 3687900 • Letter: C

Question

Create a flow chart using visual logic to represent the logic of a program that will allow the user to enter the total amount of rainfall for each of 12 months into the rainfall array. The program should then calculate the total rainfall for the year, the average monthly rainfall, as well as determine the value of the highest and lowest rainfall amounts and record the months in which they occurred. The program should display the rainfall amounts in the order in which they were entered, the total rainfall for the year, the average monthly rainfall using the Round function, and the highest and lowest rainfall amounts and the month in which they occurred, respectively. The program should produce the output shown below (Be sure and utilize console input and output):

Enter rainfall amount for month 1: 5
Enter rainfall amount for month 2: 3
Enter rainfall amount for month 3: 6
Enter rainfall amount for month 4: 1
Enter rainfall amount for month 5: 4
Enter rainfall amount for month 6: 8
Enter rainfall amount for month 7: 10
Enter rainfall amount for month 8: 2
Enter rainfall amount for month 9: 15
Enter rainfall amount for month 10: 17
Enter rainfall amount for month 11: 9
Enter rainfall amount for month 12: 14

Month 1: 5
Month 2: 3
Month 3: 6
Month 4: 1
Month 5: 4
Month 6: 8
Month 7: 10
Month 8: 2
Month 9: 15
Month 10: 17
Month 11: 9
Month 12: 14

Total Rainfall: 94
Average Rainfall: 8
Highest Rainfall of 17 occurred in Month 10
Lowest Rainfall of 1 occurred in Month 4

This is all still very confusing for me. If it's possible to answer in the most straight forward way possible I would appreciate it!

Explanation / Answer

I don't understand whether you want code or flowchart, anyway as i don't have Visual logic Softrware i am providing the code in c++ for you. from this you can easily build the flowchart

Code:

#include<iostream>
#include<iomanip>
#include<fstream>
using namespace std;
void readRainFall(float []);
void displayRainFall(float [], int);
float getTotalOfRainFall(float [], int);
float getAverageOfRainFall(float [], int);
int getIndexOfHighestRainFall(float [],int);
int getIndexOfLowestRainFall(float [],int);
int main()
{
float res,rainFall[12];
readRainFall(rainFall);
displayRainFall(rainFall,12);
res=getTotalOfRainFall(rainFall,12);
cout<<"Total rainfall : "<<res<<endl;
res=getAverageOfRainFall(rainFall,12);
cout<<"Average rain fall : "<<res<<endl;
cout<<"laregest amount of rain fall of "<<rainFall[getIndexOfHighestRainFall(rainFall,12)]<<" occured in month "<<getIndexOfHighestRainFall(rainFall,12)+1<<endl;
cout<<"smallest amount of rainFall of "<<rainFall[getIndexOfLowestRainFall(rainFall,12)]<<" Ocuured in month "<<getIndexOfLowestRainFall(rainFall,12)+1<<endl;
return 0;
}
void readRainFall(float rainFall[])
{
//Initialize month counter
int month = 0; //first month
//Read the monthly rainfall in the file
while(month <12)
{
cout<<"Enter rainfall amount for month "<<(month+1)<<" : ";
cin >> rainFall[month];
month++;
}
}//end function readRainFall
//Define the funtion displayRainFall
void displayRainFall(float rainFall[], int months)
{
cout<<"Month Rainfall ";
for(int i=0;i<months;i++)
cout<<"Month "<<i+1<<" : "<<rainFall[i]<<" ";
}
//Define the function getTotalOfRainFall
float getTotalOfRainFall(float rainFall[], int months)
{
float res=0;
for(int i=0;i<months;i++)
res+=rainFall[i];
return res;

}
//Define the function getAverageOfRainFall
float getAverageOfRainFall(float rainFall[], int months)
{
float res=0,sum;
sum=getTotalOfRainFall(rainFall,months);
res=sum/months;
return res;
}
//Define the function getIndexOfHighestRainFall
int getIndexOfHighestRainFall(float rainFall[], int months)
{
int highestIndex = 0;
float highestRainFall = rainFall[0];
for(int i =1; i < months; i++)
{
if(highestRainFall<rainFall[i])
{
highestRainFall = rainFall[i];
highestIndex = i;
}
}
return highestIndex;

}
//Define the function getIndexOfLowestRainFall
int getIndexOfLowestRainFall(float rainFall[], int months)
{
int lowestIndex = 0;
float lowRainFall = rainFall[0];
for(int i =1; i < months; i++)
{
if(lowRainFall>rainFall[i])
{
lowRainFall = rainFall[i];
lowestIndex = i;
}
}
return lowestIndex;

}

Output:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote