Answer to Question #293409 in Java | JSP | JSF for rikki

Question #293409

In a super market Mr. Amir has purchased 3 quantities of the same item. The bill is computed using the below formula Bill = quantity * price per item Requirements: a) The quantity and price per item has to be captured b) The bill has to be computed using the above formula c) Bill has to displayed


1
Expert's answer
2022-02-02T16:49:41-0500
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("Quantity:");
        int quantity = in.nextInt();
        System.out.println("Price per item:");
        double price = in.nextDouble();
        System.out.println("Bill: " + quantity * price);
    }
}

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