Imagine that you are the instructor of this course and you w

Imagine that you are the instructor of this course and you want to find the grade of all the students. First you would want the data of their test results and assignment scores. So, design a structure which will store the student\'s name, student\'s id (an eight-digit number), if the student is registered or not, marks of 10 assignments and the marks of 3 tests. Then write a function that will take the data from the structure and find the total score of students from their performance on the assignments and tests. 30% of the total score of the students will come from the assignments, 20% each for the first two test and 30% for the final test. The assignments are graded out of 30 and the tests are graded out of 100. Finally, write another function that would calculate a student\'s grade based on his total score: 90%

Solution

Answer:

#include<stdio.h>

void main()

{

int givenRolNum;

char student ;

int studentMarks ;

struct studentBase

{

int studentRolNum;

char* studentName;

int studentMarks;

};

struct studentBase studentNO[2];

studentNO[1].studentRolNum = 1;

studentNO[1].studentName = \"Student 1\";

studentNO[1].studentMarks = 95;

studentNO[2].studentRolNum = 2;

studentNO[2].studentName = \"Student 2\";

studentNO[2].studentMarks = 80;

printf(\"Please Enter Roll number of Student:\");

scanf(\"%i\",&givenRolNum);

for(int x=0;x<=2 || x==2;x++)

{

if(studentNO[x].studentRolNum == givenRolNum)

{ studentMarks = studentNO[x].studentMarks; break;

}

}

if( studentMarks>90 || studentMarks<100 || studentMarks==100)

{

printf(\"A \ \");

}

else if(studentMarks>80 && studentMarks<90)

{

printf(\"B \ \");

}

else if(studentMarks>70 && studentMarks<80)

{

printf(\"C \ \");

}

else if(studentMarks < 60)

{

printf(\"F \ \");

}

}

 Imagine that you are the instructor of this course and you want to find the grade of all the students. First you would want the data of their test results and
 Imagine that you are the instructor of this course and you want to find the grade of all the students. First you would want the data of their test results and

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site