0

Java problem

Why this doesnt work import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner myObj = new Scanner(System.in); String col = myObj.nextLine(); double var = double.parseDouble(color); double a = 40.00; dobule b = 0.0; dobule c = 0.0; b = a + var ; c = b * 1.1; System.out.println(c); }

30th Aug 2020, 6:23 PM
Ruby_Frog
Ruby_Frog - avatar
3 Respuestas
0
This is thebpaint cost code coach
30th Aug 2020, 6:46 PM
Ruby_Frog
Ruby_Frog - avatar
0
You wrote dobule = 0.0 chagne to double = 0.0 Double.parseDouble(color) This starts with uppercase D And change String col to String color
30th Aug 2020, 6:46 PM
Muhammadamin
Muhammadamin - avatar
0
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner myObj = new Scanner(System.in); String color = myObj.nextLine(); double var = Double.parseDouble(color); double a = 40.00; double b ; double c ; double d ; d = var*5; b = a + d ; c = b * 1.1; int f = (int) Math.round(c); System.out.println(f); } } This solve my problem
30th Aug 2020, 7:07 PM
Ruby_Frog
Ruby_Frog - avatar