Write a program that prompts the user to input the amount of rice, in pounds, in a bag. The program outputs the number of bags needed to store one metric ton of rice.
public class Main {
public static void main(String[] args) {
System.out.println("Enter the amount of pounds:");
Scanner scanner = new Scanner(System.in);
int pound = Integer.parseInt(scanner.nextLine());
scanner.close();
int bagsInTon = 2000 / pound;
System.out.println("The ammount of bugs: " + bagsInTon);
}
}
Comments
Leave a comment