- 4
Help me please
import java.util.scanner; public class MyClass { public static void main (String [] args ) { Scanner input = new Scanner (); double x = scn.nextDouble(); double y = scn.nextDouble(); double z = scn.nextDouble(); double a = x+y+z/3; System.out.print1n("The average is : "+ a);
3 Answers
+ 7
Kenneth Garcia ,
why not starting with a java course / tutorial. the issues that are inside your posted codes can be avoided if you build up your knowledge.
it does not make sense writing codes without knowing the basics.
you have joined sololearn just 1 hour ago. so please be patient.
in case you can not find the java tutorial, here is the link for a good start:
https://www.sololearn.com/Course/Java/?ref=app
happy coding!
+ 2
* it is "System.out.println"
* if you want to calculate the average, mind the operator precendece and add (): double a = (x+y+z) / 3
â Tag the relevant programming language!
+ 2
And don't forget that the package to import is java.util.Scanner (not ...scanner) and that you have to pass to its parameters the input application (new Scanner (System.in))