So I need help with my AP Computer science lab
here's the basics:
For this assignment, you will write a program to calculate a student's final course grade based on the student's homework, quiz, and final exam scores.
The first input to the program will be the name of the course (as a string), followed by the average amount of time the student spent on the course per week in minutes (as an int). Then, the program will then read 4 integers representing the student's homework scores, 2 decimals representing the student's quiz scores, and finally, a decimal representing the student's final exam score.
The program should then output the course name and the average time spent for the course in a week in hours and minutes. This should be followed by the average homework grade, the average quiz grade, and the final exam grade (as doubles), and an overall grade (as an int).
The overall grade should be computed as a weighted average. The weights are as follows:
Average homework grade - 35%
Average quiz grade - 15%
Final exam grade - 50%
The overall grade should be rounded to the nearest integer (NOT just truncated to the integer below).
When you write the code to produce your program's final output, take extra care to ensure all the labels used are exactly as shown in the sample run, including the colon after each label. The program which grades your solution will look for the values after these labels, so if they don't match exactly your solution may not be graded correctly.
Sample Run:
Please enter the course name.
AP Computer Science A
Please enter the average time spent in a week for this course in minutes.
135
Please enter the homework grades for this course.
75
99
80
100
Please enter the quiz grades for this course.
89.2
98.1
Please enter the final exam grade for this course.
87.58
Course name: AP Computer Science A
Weekly time spent: 2h15
Average homework grade: 88.5
Average quiz grade: 93.65
Final exam grade: 87.58
Overall grade: 89
This is my code so far:
Scanner scan = new Scanner(System.in);
System.out.println("Please enter the course name.");
String n;
n = scan.nextLine();
System.out.println("Please enter the average time spent in a week for this course in minutes.");
int t = scan.nextInt();
int k = t/60;
t = %=60;
System.out.println("Please enter the homework grades for this course.");
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
int d = scan.nextInt();
System.out.println("Please enter the quiz grades for this course.");
double x = scan.nextDouble();
double y = scan.nextDouble();
System.out.println("Please enter the final exam grade for this course.");
double z = scan.nextDouble();
System.out.println("Course name: " + n);
System.out.println("Weekly time spent: " + k + "hrs" + t );
double f = a + b + c + d;
double g = f/4;
System.out.println("Average homework grade: " + g);
double o = x+y;
double i = o/2;
System.out.println("Average quiz grade: " + i);
System.out.println("Final exam grade: " + z);
double u = z + i + g;
double r = u/3;
System.out.println("Overall grade: " + r);
What can I change or update bc rn I am only getting a 42%