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

Grade Average Program Design a grade average program that will produce the numer

ID: 3627130 • Letter: G

Question

Grade Average Program
Design a grade average program that will produce the numerical grade average of test scores input by a user.

Your program should contain the following:
• You must use an Array as your data structure to store the input grades
• You must use a Looping structure to initialize the elements of your array to clear out system garbage.
• The user may input up to 5 test scores. Hint: This does not mean each user will input 5 scores. 3 scores may be entered for calculation.
• You must use a Looping structure to traverse the elements of your array to produce your calculation.

You are to submit, as a Microsoft Word Document, the following for this assignment:
1. Pseudocode

Remember to follow the guidelines of good program design. Make sure to use meaningful variable names and thoroughly comment each line of your code. You may only use techniques learned in Chapters 1 - 5.


Example
Class WriteArray
main()
numeric ArrayLenth = 3
numeric MyArray[ArrayLength] = 2, 4, 6
numeric index = 1

While index <= ArrayLength
Print MyArray[index]
index = index + 1
endWhile
return

Explanation / Answer

#include<stdio.h>

int main()

{

                int grades[5];

                int n, sum = 0, i;

                float average = 0.0;

                char choice;

                printf( “ Welcome to the Grade Average Program!!! ”);

                do

{

printf( “ Enter the number of grades you want to enter (max. 5):”);

                                scanf(“%d”,&n);

                                sum = 0;

                                for(i = 0 ; i < 5 ; i++)

                                {

                                                grades[i] = 0;

                                }

                                for(i = 0 ; i < n ; i++)

                                {

                                                printf(“ Enter grade:”);

                                                scanf(“%d”,&grades[i]);

                                                sum+ = grades[i];

                                }

                                average = sum/n;

                                printf(“The average marks obtained is : %f”,average);

                                printf(“Do you want to continue? (y/n)”);

                                scanf(“%c”,&choice);

                }while(choice == ‘y’ || choice == ‘Y’);

return 0;

}

Hope it helps.

All The Best!!!

The logic of the program is absolutely correct.

Please do rate me.

Thanks.

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