Question

In: Computer Science

Q: In a class there are ‘n’ students. All of them have appeared for the test....

Q: In a class there are ‘n’ students. All of them have appeared for the test. The Teacher who evaluated the
sheets wants to know average marks of the class. Write code to help the teacher find average
performance, use most appropriate data type/structure for storing marks.

   write the program in c lnguage

Solutions

Expert Solution

Please check the programme which will accpet the Number of students input

and then you have to Enter the Marks for N number of students,

in the output it will show the Average marks of the class, and student wise below and above average marks

PROGRAMM

#include<stdio.h>
#include<conio.h>

struct class{
int marks;
}st[15];
void main()
{
int i,n;
float total=0,Avgmarks;
//clrscr();
printf("\nEnter the number of students in the class(<=15):");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\nEnter student %d marks :",i+1);
scanf("%d",&st[i].marks);
}
for(i=0;i<n;i++)
{
total = total + st[i].marks;
}
Avgmarks=total/n;
printf("\nAverage marks of the class = %.2f",Avgmarks);
for(i=0;i<n;i++)
{
if(st[i].marks>=Avgmarks)
{
printf("\n student %d marks = %d above the average",i+1,st[i].marks);
}
else
{
printf("\n student %d marks = %d below the average",i+1,st[i].marks);
}
}
getch();
}


Related Solutions

Q: In a class there are ‘n’ students. All of them have appeared for the test....
Q: In a class there are ‘n’ students. All of them have appeared for the test. The Teacher who evaluated the sheets wants to know average marks of the class. Write code to help the teacher find average performance, use most appropriate data type/structure for storing marks.            in c programing language ....
INSTRUCTIONS: Attempt ALL questions There are 30 students in a class. Among them, 8 students are...
INSTRUCTIONS: Attempt ALL questions There are 30 students in a class. Among them, 8 students are learning both Audit and Tax. A total of 18 students are learning Audit. If every student is learning at least one language, how many students are learning Tax in total? Among a group of students, 50 played cricket, 50 played hockey and 40 played volley ball. 15 played both cricket and hockey, 20 played both hockey and volley ball, 15 played cricket and volley...
Suppose that there is a class of n students. Homework is to be returned to students,...
Suppose that there is a class of n students. Homework is to be returned to students, but the students’ homework assignments have been shuffled and are distributed at random to students. a) Calculate the probability that you get your own homework back. (I think it is 1/n) b) Suppose that I tell you that another student, Betty, got her own homework. Does this change the probability that you get your own homework, and if so what is the new probability?...
Suppose that there is a class of n students. Homework is to be returned to students,...
Suppose that there is a class of n students. Homework is to be returned to students, but the students’ homework assignments have been shuffled and are distributed at random to students. a) Calculate the probability that you get your own homework back. (I think it is 1/n) b) Suppose that I tell you that another student, Betty, got her own homework. Does this change the probability that you get your own homework, and if so what is the new probability?...
In a psychology class, 59 students have a mean score of 98 on a test. Then...
In a psychology class, 59 students have a mean score of 98 on a test. Then 16 more students take the test and their mean score is 62.8. What is the mean score of all of these students together? Round to one decimal place. mean of the scores of all the students = 57 randomly selected students were asked how many siblings were in their family. Let X represent the number of pairs of siblings in the student's family. The...
In a class of 25 students, 24 of them took an assignment in class and 1...
In a class of 25 students, 24 of them took an assignment in class and 1 student took a make-up assignment the following day. The professor graded the first batch of 24 assignments and found an average score of 74 points with a standard deviation of 8.9 points. The student who took the make-up the following day scored 64 points on the assignment. (a) Does the new student's score increase or decrease the average score? how (b) What is the...
The average height for a student in a class with n = 60 students is a...
The average height for a student in a class with n = 60 students is a random variable with an average height of 180 cm and standard deviation σ = 10. The individual heights which make up that average are i.i.d. (1) use Chebyshev’s inequality to find an upper bound for the probability that the average of the class (obtained from the individual student heights) is greater than 200cm. (2) Use Chebyshev’s inequality to upper bound the probability that the...
Three metal spheres (A, B, C) all have the same charge +Q on them. The spheres...
Three metal spheres (A, B, C) all have the same charge +Q on them. The spheres have radii of RA = 1m, RB = 2m, and RC = 4m respectively. Rank the magnitude of the electric field at a distance r = 3m in each case. a. EA < EB < EC b. EC < (EA = EB) c. EA = EB = EC d. EC < EB < EA
A: You recently took a statistics class in a large class with n = 500 students....
A: You recently took a statistics class in a large class with n = 500 students. The instructor tells the class that the scores were Normally distributed, with a mean of 7 2 (out of 100 ) and a standard deviation of 8 , but when you talk to other students in the class, you find out that more than 30 students have scores below 45 . That violates which rule for the Normal distribution? the 30–60–90 rule the 1–2–3...
A math department gives all college algebra students a test to test rather or not students...
A math department gives all college algebra students a test to test rather or not students taking college algebra on site perform better on Final than students that take class completely online. The Math department gathers random samples of 40 on-site students (Students who take class in the classroom) and 35 online students. The test score for each student in the random sample is determined. The mean score for the on-site students is 75, with a standard deviation of 12....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT