You are to write a C++ program to compute the final grade for a course. Student
ID: 3569201 • Letter: Y
Question
You are to write a C++ program to compute the final grade for a course. Student ID numbers, which should be pure numerical number and may be as large as nine digits, identifies students. The final grade is composed of two parts, homework average counts for 40 percent and test average counts for 60 percent. There are two tests; each has maximum points of 100. There are seven homework assignments, with maximum points of 25, 30, 40, 50, 35, 35 and 50 respectively. Homework average is computed by adding all the homework scores together then divide by maximum possible points. The final grade needs to be converted to letter grade, and the scale is listed below:
> 90 A
80
Explanation / Answer
class Div { public static void main(String args[]) { int maths, physics, chem, hindi, english; maths = Integer.parseInt(args[0]); physics = Integer.parseInt(args[1]); chem = Integer.parseInt(args[2]); hindi = Integer.parseInt(args[3]); english = Integer.parseInt(args[4]); float sum = maths + physics + chem + hindi + english; System.out.println("Total marks " +sum); float per= sum/5; System.out.println("Percentage is "+per); if(per>=65) { System.out.println("Ist divison"); } else if(per >=55 && per <65) { System.out.println("IInd division"); } else if(per >=40 && per <55) { System.out.println("IIIrd divison"); } else { System.out.println("Fail"); } } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.