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

Assignment: Arrays are incredible fun! Today we are going to work on a program t

ID: 3660104 • Letter: A

Question

Assignment: Arrays are incredible fun! Today we are going to work on a program to keep track of our homework scores for a math class. Write a program that accepts five homework scores as input values and stores them into a table (which is another name for an array). Once the scores are in the array, we can process them again and again. First, load the scores in your array. Second, display the contents of the array in order. Third, display array in reverse order. Fourth, calculate the average of the five scores entered in the array. Finally, the algorithm should display all the homework scores in the array that are larger than the previously calculated average. Make sure you use some output statements to clarify all the details you are displaying, being cautious about spelling and communicating to your user. Be sure to THINK about the logic and design first (IPO chart and or pseudocode), then code the Visual Logic command line processing. Rubric: When completed staple the following documents together neatly in 1,2,3,4 order: 1) Code the visual logic

Explanation / Answer

#include<stdio.h> #include<conio.h> //dont use this header in linux void main() { int array[5],i,tot=0; //array of size 5 float avg=0.00; printf("Enter the Homework scores:"); //Entering the scores for(i=0;i<5;i++) scanf("%d",&array[i]); //Storing in the table printf("Scores in order:"); for(i=0;i<5;i++) { printf("%d ",array[i]); //Scores in given order } printf("Scores in reverse:"); //Scores in reverse order for(i=4;i>=0;i--) { printf("%d ",array[i]); } for(i=0;i<5;i++) tot+=array[i];    avg=(float)tot/5; //Average printf("Average=%f ",avg); printf("Scores greater than average:"); for(i=0;i<5;i++) { if(array[i]>avg) printf("%d ",array[i]); //Scores greater than average } getch(); //Dont use in linux }
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