+ 1

I'm writing a program to help calculate a formula at work. Is there an easy way to write this code also is it possible in java

https://sololearn.com/compiler-playground/c7TGpxj0t1Pr/?ref=app

29th Jan 2025, 4:45 AM
Badger Boy
Badger Boy - avatar
4 Réponses
+ 2
import java.util.Scanner; public class Calculate { static Scanner sc = new Scanner( System.in) .useDelimiter( "\n"); public static void main(String[] args) { int LM, UPS, UPE; System.out.print( "LM = "); LM = sc.nextInt(); System.out.print( "UPS = "); UPS = sc.nextInt(); System.out.print( "UPE = "); UPE = sc.nextInt(); double M = LM * 0.0895 * 0.0215, UPT = UPS - UPE, UPP = UPT / M; System.out.printf( """ m3 Total: %f Total Ltr: %f Uptake: %f """, M, UPT, UPP); } }
29th Jan 2025, 11:23 PM
zemiak
+ 2
Please do not paste the code here. Instead, give us the link to your code like this: https://sololearn.com/compiler-playground/cZ5o1gkY5WBh/?ref=app That way, people can fully see and run your code directly.
29th Jan 2025, 7:39 AM
Dragon RB
Dragon RB - avatar
+ 2
Yeah, you could write the code in Java.
29th Jan 2025, 7:45 AM
Ausgrindtube
Ausgrindtube - avatar
0
Sorry didn't know. Updated it
29th Jan 2025, 8:13 AM
Badger Boy
Badger Boy - avatar