










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











Summative Feedback: Resubmission Feedback:
I. Sceenshot & Explain
1. Problem. A math teacher wants to manage grades of a class. He asks you to help him to write a small application to do that. He needs to enter student IDs, student’s grades and store these information into 2 separate arrays (integer array for IDs and float array for grades). Then he needs to print all student IDs together with their grades. Finally, he needs to know which student has highest grade and lowest grade. Your program should be menu based with the options above. When an option is done, the program should go back to the main menu so he can choose another option. There should be an option to quit program. 2. Solve problem.
Menu Options:
Function find the highest grades of student:
4. Sceenshot. Menu Options: Enter student’s information(2-10): Figure 8. Input information of student Figure 7. Menu Options.
Find the lowest grades of student: Figure 11. Find the lowest grades of student. Exit program: Figure 12. Exit program
II. Test plan Test case What is being test How Data Expected Result Result Evaluate 1 User input selection Int choice Range:1- 5 Try to input boundary data, typical data, bad data A,b,c,,&… Typical data(1,2,..) Decimal in typical data(1.1,1.2…) Bad data(statement) Boundary data Error Accepted Error Error Error Error Accepted Accepted Error Accepted Pass Pass False Pass Pass 2 Input the number of student ID[10] Try to input boundary data, typical data, bad data A,b,c,,&… Typical data(1,2,3..) Decimal in typical data(1.1,1.2…) Bad data(statement) Boundary data Error Accepted Error Error Error Error Accepted Accepted Error Error Pass Pass False Pass Pass 3 Input the student ID Int ID[10] Try to input boundary data, typical data, bad data A,b,c,*,&… Typical data(1,2,3..) Decimal in typical data(1.1,1.2…) Bad data(statement) duplicate with the Error Accepted Error Error Error Accepted Accepted Accepted Accepted Error Flase Pass False False Pass
III. Evaluation of code After testing and checking my application error, I found that my application has many shortcoming such as:
do{ printf("%d. Enter grade's student: ",i+1); scanf("%f", &Grades[i]); if (Grades[i]<0|| Grades[i]>10){ printf ("Enter a wrong grade for the student, please enter again \n"); } }while (Grades[i]<0|| Grades[i]>10); i++; } while (i < n); } void Display() { int i=0; do { printf("Students ID: %d\n| Grades:%.2f\n", IDs[i],Grades[i]); i++; } while (i<n); } void maxGrades () { int maxID = IDs[0]; int i;
if (Grades[i] == min){ printf("Student has lowest grades: %.2f | ID: %d.\n", min,IDs[i]); } } } int main () { int choice; do{ printf (" 1. Input student's ID & Grade\n"); printf (" 2. view student's ID & Grade \n"); printf (" 3. Find student's who has highest grades \n"); printf (" 4. Find student's who has lowest grades \n"); printf (" 5. Exit program \n "); printf ("Pleas...Input your choice: "); scanf ("%d",&choice); switch (choice){ case 1: do { printf("How many students do you want to enter(2-10): "); scanf("%d", &n); if (n<2 || n>10){ printf (" Enter the wrong student number, please enter again: \n"); } } while (n<2 || n>10);
input(); system("cls"); break; case 2: printf("view student's ID & Grade\n"); system("cls"); Display (); break; case 3: printf("Find student's who has highest grade\n"); system("cls"); maxGrades (); break; case 4: printf ("Find student's who has lowest grades \n"); system("cls"); minGrades(); break; case 5: printf ("Exiting program ... \n"); exit(0); system("cls"); return 0; break; default: