Question: plz make sure , you use the provided code , just modify them with function. You can keep For loop but plz avoid if-then .
plz make sure , you use the provided code , just modify them with function. You can keep For loop but plz avoid if-then . Plz don't add any complex method . Do simple coding . Thanks in advance . Really appreciate your help !!


Previous Code is here :
#include// creating instance varriable to make a comparative graph by using null or
void method
void Data(double values,char items)
{ int rain=(int)values; // inisitate rain as an integer and Assigning values to rain
int amount=(int)(values-rain)*10; // make an argument where input will make a number of pattern
int i,j; // initilize i and j as an integer for(i=1;ilast input and make dependent item varriable{ for(j=1;j{
} }
printf("%c",items);// print an output :: Monthsfor(i=1;i{ printf("%c",items);} }
int main() {
int i; // initilize i new integerchar months[6][20]={"January : ","February :","March :","April :","May :","June :"}; // making array for showup the graph by calculating valueprintf(" "); float normal[6],current[6],normal_total,current_total; // make array asfloat
int current_maximum; // creat feild for maximum cuurent rain by using integerprintf("Enter 6 months data normal Vs 2018 by sequentially : ");for(i=0;i{ scanf("%f",&normal[i]); // scanning ,input normal valuesscanf("%f",¤t[i]); // taking input current month 2018 jan to jun values}
printf("Entered data: "); printf("Normal Months vs 2018 Months : "); // Showing input dates in 2row by normal vs currentfor(i=0;iprintf("%.1f %.1f ",normal[i],current[i]); // print result after 1 point of decimal value} for(i=0;ito make a graph{ printf(" %s " , months[i] );printf(" | "); // line break Data(normal[i],'*'); // normal rain times * to show up "*" the graph printf(" | ");Data(current[i],'!'); }printf(" | "); printf(" "); for(i=1;iprintf("----%d ",i); // Making the standred 8 point line where each point carrie .2 and 5 interval , there is point of 1,2,3,4,5,6,7,8}
normal_total=normal[0];current_total=current[0];current_maximum=0;for(i=1;i{ normal_total+=normal[i];current_total+=current[i]; if(current[current_maximum] current_maximum=i;}
printf(" Total rain fall was : %.2f mm ",normal_total);printf(" Total rain fall for 2018 was : %.2f mm ",current_total);if(normal_total>current_total) // if statement compare perticular data and findout the highest in normal{ printf(" 2018 was drier than normal by %.2f mm ",normal_total-current_total); }else
printf(" Normal was drier than 2018 by %.2f mm ",current_total- normal_total); // if the highest doesn't workout then else will print the highest of cuurentprintf(" The month is %s and the rain fall amount, with highest rain fall in 2018 was : %. 2f ",months[current_maximum],current[current_maximum]); // showing total rainfall}
***Please Use provided Program solution In the last_page and use them and modify them PROBLEM: Re-do (Following Program) in the bottom the C program you wrote to use the following functions. Fix any problems you had with the original program. Produce the EXACT output shown at the end of the document. 1. Generate a graph that compares, on a month-by-month basis, the monthly rainfall for Kamloops for the first half of 2018 (i.e. Jan June) versus the normal (30 year average) rainfall for Kamloops for the same months 2. Create and call a function to return the month name to main() 3. Create and call ONE function to print one line of symbols . Call it the first time to print the line of * . Call it a second time to print the line of! . No if statement is needed or allowed in this function . Think very carefully about the parameter list for this function 4. Call a function to print the scale and the legend as shown below 5. Call a function to find and print the total rainfall for each data set, and also the comparison of the two totals. The function will state whether 2018 was wetter, drier, or equal to a normal 6 month rainfall and by how much 6. Call a function to determine which month in 2018 had the highest rainfall, and print the month name (using the function described in #2), the rainfall amount and how that amount compares to the normal amount for that month Input will consist of 6 pairs of numbers representing the normal rainfall for the month and the 2018 rainfall amount for the same month. Use the exact data shown below when you run your program, Note: to work with any data that has this format data and output below are for illustration purposes only.Your program must be able 3.1 5.4
// creating instance varriable to make a comparative graph by using null or void method void Data(double values,char items) int rain-(int)values; /inisitate rain as an integer and Assigning values to rain int amount (int) (values-rain) 10; // make an argument where input will make a number of pattern inti,j; // initilize i andj as an integer for(i-1;i // creating instance varriable to make a comparative graph by using null or void method void Data(double values,char items) int rain-(int)values; /inisitate rain as an integer and Assigning values to rain int amount (int) (values-rain) 10; // make an argument where input will make a number of pattern inti,j; // initilize i andj as an integer for(i-1;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
