Write a grading program for an instructor whose course has the following polocie
ID: 3625309 • Letter: W
Question
Write a grading program for an instructor whose course has the following polocies:Two quizzes,each graded on the vasis of 10 points.are gicen.
One midterm exam and one final exam and one final exam. each graded on the basis of 100 points, are given.
The final exam counts for 50 percent of the grade, the midterm counts for 25 percent, and the two quizzes together count for a total of 25 percent.
any grade of 90 percent or more is an A, any grade between 80 and 89 percent is a B and so ------.
The program should read in the student's scores and display the student's recors. which consists of two quiz scores.two exam scores. the student's total score for the entire course, and the fianl letter grade. the total score is a numger in the range 0 to 100, which represents the weighted average of the student's work.
Explanation / Answer
please rate - thanks
import java.util.*;
public class weighted_average
{static Scanner in=new Scanner(System.in);
public static void main(String[] args)
{
String name;
int q1,q2,mt,fexam;
char grade;
double ts;
q1=grades("Quiz1",10);
q2=grades("Quiz 2",10);
mt=grades("Midterm",100);
fexam=grades("Final Exam",100);
ts=fexam*.5+mt*.25+(q1+q2)/20.*100.*.25;
grade=getgrade(ts);
System.out.println(" Grades");
System.out.println("Quiz 1 " + q1);
System.out.println("Quiz 2 " + q2);
System.out.println("Midterm " + mt);
System.out.println("Final Exam " + fexam);
System.out.println("Total Score " + ts);
System.out.println("Final Grade " + grade);
}
public static int grades(String name,int max)
{int grade;
System.out.print("Enter "+name+" grade ");
grade=in.nextInt();
while(grade<0||grade>max)
{System.out.println("must be between 0 and "+max);
System.out.print("Enter "+name+" grade ");
grade=in.nextInt();
}
return grade;
}
public static char getgrade(double g)
{if(g>=90)
return 'A';
if(g>=80)
return 'B';
if(g>=70)
return 'C';
if(g>=60)
return 'D';
return 'F';
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.