Design a program in C whose task is to manage the grades of M students in a clas
ID: 3534354 • Letter: D
Question
Design a program in C whose task is to manage the grades of M students in a class in which N quizzes of equal weighting are given during the course of a semester. The program is to do the following in the indicated sequence when the program is executed:
1. Ask the user to type on the keyboard the number of students M and the number of quizzes N, which represent the number of rows and the number of columns, respectively, in a two-dimensional array x[M][N] of floating-point numbers.
2. Ask the user to type on the keyboard the values of all the elements of the array x[M][N], with all of the quiz grades being ? 10 points.
3. Display on the console the M rows and N columns of inputted array element values.
4. Generate and display on the console the elements of a one-dimensional array a[N] where each element of a[N] represents the average grade in the class in each of the N quizzes .
5. Generate and display on the console the elements of a one-dimensional array b[M] where each element of b[M] represents the average grade over the semester of each of the M students .
6. Generate and display on the console the averge grade for the entire class over the entire semester.
Your design is to be in the form of two separate programs:
Program A:This design will perform the above steps without utilizing prototype functions.
Program B: This design will do the same thing as Program A but now the program design will utilize multiple prototype functions.
Explanation / Answer
#include<stdio.h>
main()
{
int m1,m2,m3,total;
float per;
clrscr();
printf("enter 3 nos.");
scanf("%D%D%D",&m1,&m2,&m3);
total=m1+m2+m3;
per=total*100/300;
if(per>=60&&per<=100)
printf("ist");
else if(per>=50&&per<=60)
printf("2nd");
else if(per>=40&&per<=50)
printf("3rd");
else
printf("fail");
getch();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.