Ok, I need help finishing my homework. I do not want the answers, just hints that will take me to finish the program. I am still a begginer at java so bear with me please.

This is my hmw:
Write a java program to help students to calculate his/her grade. The program will prompt user for the following inputs: attendance grade, assignment grades, 2 exam grades, a lab grade, and a grade of the final exam. It then calculates the weighted average and print on the screen both this value and a letter grade the student will receive. Your program should work for as many students as what user needs. The following is the sample screen display where the user inputs are underlined.
Please enter you attendance grade : 95
Please enter 5 assignment grades: 80 85 65 85 90
After the lowest grade is dropped, your assignment average is 85.0
Please enter 2 exam grades: 70 80
Please enter the grade of your final exam: 70
Please enter the lab grade: 100

The weighted average is:
95.0 * 5% + 85.0 * 20% + 70 * 15% + 80 * 15% + 70 * 25% + 100 * 20% = 81.75
You will receive B.

Do you want to calculate for another student? Please type true or false.
Please enter 5 assignment grades: …
… // screen display for the next student
Do you want to calculate for another student? Please type true or false.

So far i have this:

import java.util.Scanner;

public class JL7{

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);

double average, assignmentaverage;
int as1, as2, as3, as4, as5, ex1, ex2, lab, finalGrade;

as1 = sc.nextInt();
as2 = sc.nextInt();
as3 = sc.nextInt();
as4 = sc.nextInt();
as5 = sc.nextInt();
ex1 = sc.nextInt();
ex2 = sc.nextInt();
finalGrade = sc.nextInt();
assignmentaverage = 85;
average = assignmentaverage * .20 + ex1 * .15 + ex2 .20 + lab * .20 + finalGrade * .25();


Recommended Answers

All 2 Replies

You probably want to print the average, and amy other results you calculate.
You can put all that inside a while loop so it will keep repeating the input and calculations until thr user types false.

even better, put it all inside a method and just call that in your loop. Much easier to read...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.