Help me please | Sololearn: Learn to code for FREE!
- 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);

3rd Jan 2022, 6:08 PM
Kenneth Garcia
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!
3rd Jan 2022, 6:40 PM
Lothar
Lothar - avatar
+ 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!
3rd Jan 2022, 6:29 PM
Lisa
Lisa - avatar
+ 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))
3rd Jan 2022, 6:31 PM
VCoder
VCoder - avatar