0

can someone help me its java language

1st Sep 2021, 12:45 PM
Ze Shion
Ze Shion - avatar
9 Respostas
+ 3
Ze Shion , your code is truncated so it is incomplete. please put your complete code in playground and link it here. thanks!
1st Sep 2021, 12:51 PM
Lothar
Lothar - avatar
+ 3
are you sure that the code is complete now? it does not contain a main() method.
1st Sep 2021, 6:20 PM
Lothar
Lothar - avatar
+ 1
Ze Shion please paste your code in code playground and paste the link here
1st Sep 2021, 12:55 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
+ 1
You gotta learn some things here: 1) every runnable code in Java, has to be inside a class. It's a rule of Java. So wrap your whole program inside a class for now. 2) your program starts running at the start of the main() function. Where is your main function? If you don't have one, add one and write your runnable instructions there. Ping me if you have any further doubts
2nd Sep 2021, 11:21 AM
Rishi
Rishi - avatar
0
public static void Name (String name){ Scanner in = new Scanner (System.in); double math = 0, science = 0, english = 0, PE = 0, music = 0; System.out.print("Input Math grade: "); math = in.nextDouble(); System.out.print("Input Science grade: "); science = in.nextDouble(); System.out.print("Input English grade: "); english = in.nextDouble(); System.out.print("Input P.E grade: "); PE = in.nextDouble(); System.out.print("Input Music grade: "); music = in.nextDouble(); double sum = math + science + english + PE + music; double average = sum / 5; System.out.println("The average is: " + average); if (average <= 100 && average >= 96) { System.out.println("Numerical grade is: 1.0"); System.out.println("Remarks: Congratulations " + name + ". you PASSED!"); } else if (average <= 95 && average >= 90) { System.out.println("Numerical grade is: 1
1st Sep 2021, 12:45 PM
Ze Shion
Ze Shion - avatar
0
Show me your code after you've fixed it, Lemme see how it is
3rd Sep 2021, 1:04 AM
Rishi
Rishi - avatar
- 1
idunno that why i need some help how to fix the code
1st Sep 2021, 6:26 PM
Ze Shion
Ze Shion - avatar
- 1
thank you
2nd Sep 2021, 1:27 PM
Ze Shion
Ze Shion - avatar