0
Code Coach Input Problem(Hovercraft)
How can I integrate the input into my code?
9 Respuestas
+ 2
Just add:
import java.util.Scanner;
+ 1
how did you try?
could post your attempt.
+ 1
public class Program
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int customers = input.nextInt();
var costs = 20000000 + 1000000;
var sales = customers * 3000000;
if (sales > costs){
System.out.println("Profit");
}
else if (costs > sales){
System.out.println("Loss");
}
else if (costs == sales){
System.out.println("Broke Even");
}
else{
System.out.println("?");
}
}
}
+ 1
You forgot to import the Scanner class Shania
0
Please put the used programming languages.
0
Sorry, i meant Java
0
I had no idea how to do it, so I just copied the pre written method from another code coach problem
0
Thank you 👍🏻😊
0
You're welcome Shania :)