0
can someone help me its java language
9 Answers
+ 3
Ze Shion ,
your code is truncated so it is incomplete. please put your complete code in playground and link it here.
thanks!
+ 3
are you sure that the code is complete now? it does not contain a main() method.
+ 1
Ze Shion please paste your code in code playground and paste the link here
+ 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
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
0
Show me your code after you've fixed it, Lemme see how it is
- 1
idunno that why i need some help how to fix the code
- 1
thank you