Answer to Question #316229 in Java | JSP | JSF for java rice

Question #316229

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.

1
Expert's answer
2022-03-22T19:07:42-0400
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); 

    }
    
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS