Bellow is what i have so far on my assignment. I need some help getting this application working. Thank you for your time!
/**
General Assignment:
Review the grading policy on the CSCI 181 syllabus.
The course grade is determined by the weighted average of six components with two possible penalties added.
The six components with associated weights are Homework (5%), FeedBack Surveys(5%), Class Labs(10%), Programs(20%), Exams(30%), and Final(30%).
If the value for the program component is less than a C (14.5%), a penalty of -24(*programScore - 14.5)/14.5 is added to final grade.
If the value of the final exam component is less than a C (21.75%), a penalty of -24*(finalScore - 21.75)/21.75 is added to final grade.
Write a program that will allow the user to enter possible and actual points for each component, compute the course average, and assign a
letter grade according to the following table:
A : 92.50%+
B+: 86.50%
C+: 76.50%
D+: 66.50%
F: below 59.50%
A-: 89.50%
B: 82.50%
C: 72.50%
D: 59.50%
B-: 79.50%
C- : 69.50%
*/
import java.util.Scanner;
import java.text.DecimalFormat;
public class CsciGradeCalculator {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);//import scanner
//prompts
System.out.print("CS181 Grade Calculator\n\n");
System.out.print("Please enter possible & actual points for exercises: ");
double exercisesPossible = keyboard.nextDouble();
double exercisesActual = keyboard.nextDouble();
System.out.print("Please enter possible & actual points for feedback: ");
double feedbackPossible = keyboard.nextDouble();
double feedbackActual = keyboard.nextDouble();
System.out.print("Please enter possible & actual points for labs: ");
double labsPossible = keyboard.nextDouble();
double labsActual = keyboard.nextDouble();
System.out.print("Please enter possible & actual points for programs: ");
double programsPossible = keyboard.nextDouble();
double programsActual = keyboard.nextDouble();
System.out.print("Please enter possible & actual points for exams: ");
double examsPossible = keyboard.nextDouble();
double examsActual = keyboard.nextDouble();
System.out.print("Please enter possible & actual points for final: ");
double finalPossible = keyboard.nextDouble();
double finalActual = keyboard.nextDouble();
keyboard.close();
//calculate
double exercisesResults = exercisesActual / exercisesPossible;
double feedbackResults = feedbackActual / exercisesPossible;
double labsResults = labsActual / labsPossible;
double programsResults = programsActual / programsPossible;
double examsResults = examsActual / examsPossible;
double finalResults = finalActual / finalPossible;
// weights: Homework (5%), FeedBack Surveys(5%), Class Labs(10%), Programs(20%), Exams(30%), and Final(30%).
double exercisesWeight = 0.05;
double feedbacklWeight = 0.05;
double labsWeight = 0.10;
double programslWeight = 0.20;
double examsWeight = 0.30;
double finalWeight = 0.30;
int programPenalty;
int finalPenalty;
//calculate grade letter
String letter;
if(finalResults>=92.5){
letter="A";
System.out.println(letter);
}
else if(finalResults>=89.5){
letter="A-";
}
else if(finalResults>=86.5){
letter="B+";
}
else if(finalResults>=82.5){
letter="B";
}
else if(finalResults>=79.5){
letter="B-";
}
else if(finalResults>=76.5){
letter="C+";
}
else if(finalResults>=72.5){
letter="C";
}
else if(finalResults>=69.5){
letter="C-";
}
else if(finalResults>=66.5){
letter="D+";
}
else if(finalResults>=59.5){
letter="D";
}
else{
letter="F";
}
//results
System.out.println("\nComponent\t\0|Weight |\0Possible |\0Actual |\0Score");
System.out.printf("=======================================================================\n");
System.out.printf("Exercises | %f | %f | %f | %f \n", exercisesWeight, exercisesPossible, exercisesActual, exercisesResults);
System.out.printf("Feedback | %f | %f | %f | %f \n", feedbacklWeight, feedbackPossible, feedbackActual, feedbackResults);
System.out.printf("Labs | %f | %f | %f | %f \n", labsWeight, labsPossible, labsActual, labsResults );
System.out.printf("Programs | %f | %f | %f | %f \n", programslWeight, programsPossible, programsActual, programsResults);
System.out.printf("Exams | %f | %f | %f | %f \n", examsWeight, examsPossible, examsActual, examsResults);
System.out.printf("Final | %f | %f | %f | %f \n", finalWeight, finalPossible, finalActual, finalResults);
System.out.printf("Program Penalty |----------------------------| 3d \n");
System.out.printf("Final Penalty |----------------------------| 3d \n");
System.out.printf("========================================================================\n");
System.out.printf("Course Average |----------------------------| %f \n", finalResults, letter);
}
}