fPaste.me

A free, anonymous, minimalist and open source paste tool.


Untitled
25-10-2019 08:07:41
Anonymous
import java.util.*;
public class grading {

public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner (System.in);
String line = "--------------------";

System.out.println(line);
System.out.println("MIDTERM GRADING\n" + line);
int quiz1, quiz2, quiz3, assign, lwork, swork, recit, midExam;

System.out.print("Input Quiz#1: ");
quiz1 = in.nextInt();
System.out.print("Input Quiz#2: ");
quiz2 = in.nextInt();
System.out.print("Input Quiz#3: ");
quiz3 = in.nextInt();
System.out.print("Input Assignment: ");
assign = in.nextInt();
System.out.print("Input LWork: ");
lwork = in.nextInt();
System.out.print("Input SWork: ");
swork = in.nextInt();
System.out.print("Input Recitation: ");
recit = in.nextInt();

double cpg = ((quiz1 + quiz2 + quiz3 + assign + lwork + swork + recit) / 7)
* 0.60;
System.out.print("Class Participation Grade: " + cpg);

System.out.print("\nInput Midterm Exam: ");
midExam = in.nextInt();

double midGrade = cpg + (midExam * 0.40);
System.out.println("Midterm Grade: " + midGrade + "\n");

int fQuiz1, fQuiz2, fQuiz3, fAssign, fLWork, fSWork, fRecit, fExam;
System.out.println(line + "\nFINAL GRADING\n" + line);

System.out.print("Input Final Quiz#1: ");
fQuiz1 = in.nextInt();
System.out.print("Input Final Quiz#2: ");
fQuiz2 = in.nextInt();
System.out.print("Input Final Quiz#3: ");
fQuiz3 = in.nextInt();
System.out.print("Input Final Assignment: ");
fAssign = in.nextInt();
System.out.print("Input Final LWork: ");
fLWork = in.nextInt();
System.out.print("Input Final SWork: ");
fSWork = in.nextInt();
System.out.print("Input Final Recitation: ");
fRecit = in.nextInt();
double fCPG = ((fQuiz1 + fQuiz2 + fQuiz3 + fAssign + fSWork + fSWork + fRecit) / 7)
* 0.60;
System.out.print("Input Final Exam: ");
fExam = in.nextInt();

double fGrade = fCPG + (fExam * 0.40);
System.out.print("Final Grade: " + fGrade);

System.out.println("\n" + line);
double oGrade = (midGrade * 0.50) + (fGrade * 0.50);
System.out.print("Midterm Grade: " + midGrade + "\n" +
"Final Grade: " + fGrade + "\n" +
"Overall Grade: "+ oGrade);

}
}