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

Test Plan for course grading software Software to calculate and display grades f

ID: 638730 • Letter: T

Question

Test Plan for course grading software
Software to calculate and display grades for a high school course works as follows:

The software has a Student class with the following properties:

- student number (String)

- last name (String)

- first name (String)

- an array of scores on tests 1 through 10 (array of integers)

- final grade (double)

The Student class has constructors, get and set methods for each property, and the following:

- a method to let the teacher input a grade for a single test

- a method to calculate the final grade (an average of all 10 tests)

- a method to display a histogram (bar chart) of all 10 test scores grades for any student

The method that prints a histogram calls the histogram() method from the exisiting DataGraph Class which has been professionally validated.

CSCI 111 Chapter 13

Explanation / Answer

#include<stdio.h>
/*Global Variable declaration*/
int Students;
int Test;
int Quiz;
int Hwk;
int A,B,C,D,F;
int minGrade;
int maxGrade;
int classsum;
float classavg;
float TestAve;
float QuizAve;
float HwkAve;

/*Function Prototypes*/
void introduction();
void getData();
void CalculateGrade(float);
void StudAverage();
void ClassSummary();
void runMenu();
void Thankyou();

void introduction()
{
printf("Welcome to the Gradebook Program. ");
}
void getData()
{
printf(" Please enter the number of students: ");
scanf("%d",&Students);
printf(" Enter the minimum grade allowed: ");
scanf("%d",&minGrade);
printf(" Enter the maximum grade allowed: ");
scanf("%d",&maxGrade);
}
void CalculateGrade(float grade)
{
/*if statements to find the letter grade*/
if((grade>=90)&&(grade<=100))
++A;
if ((grade>=80)&&(grade<90))
++B;
if ((grade>=70)&&(grade<80))
++C;
if ((grade>=60)&&(grade<70))
++D;
if ((grade>=0)&&(grade<60))
++F;
}
void StudAverage()
{
int sum=0;
float StudAvg=0;
int n;
printf(" Enter number of Test grades : ");
scanf("%d",&Test);
printf(" Enter number of Quiz grades : ");
scanf("%d",&Quiz);
printf(" Enter number of Homework grades : ");
scanf("%d",&Hwk);


for(n=1;n<=Students;n++)
{
printf(" Student %d ",n);
sum=0;
float t;
for(int i=0;i<Test;i++)
{
do
{
printf("Enter Test Grade %d :",i+1 );
scanf("%f",&t);
/*test if user is entering a valid number*/
if(t<minGrade||t>maxGrade)
printf("Invalid Entry...Tray Again ");
}
while(t<minGrade||t>maxGrade);
/* Add test marks to sum*/
sum = sum + t;
classsum=classsum+sum;
}
  
TestAve=sum/Test;
  
sum=0;
for(int i=0;i<Quiz;i++)
{
do
{
printf("Enter Quiz Grade %d :",i+1 );
scanf("%f",&t);
/*test if user is entering a valid number*/
if(t<minGrade||t>maxGrade)
printf("Invalid Entry...Tray Again ");
}
while(t<minGrade||t>maxGrade);
/* Add test marks to sum*/
sum = sum + t;
classsum=classsum+sum;
}
QuizAve=sum/Quiz;
  
sum=0;
for(int i=0;i<Hwk;i++)
{
do
{
printf("Enter Homework Grade %d :",i+1 );
scanf("%f",&t);
/*test if user is entering a valid number*/
if(t<minGrade||t>maxGrade)
printf("Invalid Entry...Tray Again ");
}
while(t<minGrade||t>maxGrade);
/* Add test marks to sum*/
sum = sum + t;
classsum=classsum+sum;
}
HwkAve=sum/Hwk;
  
/* Calculate & display Student Average*/
StudAvg=(.5*TestAve) + (.3*QuizAve) + (.2*HwkAve);
printf(" Student Average = %.2f ",StudAvg);
  
/*Calculate student grade*/
CalculateGrade(StudAvg);
/* Calculate class sum */
  
}//end for
  
}
void ClassSummary()
{
int x;
printf(" Class Summary ");
/*Calculate Class average*/
classavg=(classsum/3)/Students;
printf(" Class Average = %.2f",classavg);

printf(" A:%i B:%i C:%i D:%i F:%i ",A,B,C,D,F);
printf(" ");
printf(" Historgram ");
/*print histograms graphically representing the counts*/
printf("A: ");
for (x=1;x<=A;++x)
printf("*");
printf(" ");
  
printf("B: ");
for (x=1;x<=B;++x)
printf("*");
printf(" ");

printf("C: ");
for (x=1;x<=C;++x)
printf("*");
printf(" ");

printf("D: ");
for (x=1;x<=D;++x)
printf("*");
printf(" ");

printf("F: ");
for (x=1;x<=F;++x)
printf("*");
printf(" ");   
}
void runMenu()
{
int ch=0;
do{
printf(" Menu ") ;
printf("1 - Student Average ");
printf("2 - Class Summary ");
printf("3 - Quit ");
printf("Enter your choice: ");
scanf("%d",&ch);
switch(ch)
{
case 1:
StudAverage();
break;
case 2:
ClassSummary();
break;
case 3:
return;
}
}while(ch!=3);
}
void Thankyou()
{
printf(" Thank you for using Gradebook ");
}
int main(void)
{
introduction();
getData();
runMenu();
Thankyou();
return 0;
}

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