0

hey, i am new and i just can't understand something in the math thing, if case1 wants like 16 but case2 wants something differen

Let's say something like: int PIZ = 8; int PIZ2 = 2; int total = PIZ * PIZ2; System.out.println(total); Thats a one code i cant do different outputs in 1 code

10th Jan 2022, 3:35 PM
Pizza Is Cool
Pizza Is Cool - avatar
2 Réponses
+ 2
I think what you want to do is getting user input. It is explained in 👉lesson 5 of the Java course on sololearn. 👉Please tag the relevant programming in your thread!👈
10th Jan 2022, 3:39 PM
Lisa
Lisa - avatar
+ 2
On code projects, sololearn acts as if a user gives input. Look at the scanner variable and then get input like this: double radius = scanner.nextDouble() It means you get a number and store it in a variable called radius. So depending on input, radius can have a different values. Use the variable radius then for your calculations.
10th Jan 2022, 4:06 PM
Lisa
Lisa - avatar