TotalPrice - System.out.print("Please enter...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * will recieve price and quantity information from user, * calculate and display the total price. */ package totalprice; import java.util.Scanner; /** * * @author Manny */ public class TotalPrice { /** * @param args the command line arguments */ public static void main(String[] args) { // Start here // 1. Input to the program Scanner in = new Scanner(;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: System.out.print("Please enter the price of product: "); double unitPrice = in.nextDouble(); System.out.print("Please enter the quantity of product: "); int unitQuantity = in.nextInt(); // 2. Process double totalPrice= unitPrice * unitQuantity; // 3. Output System.out.println(" The total price is: " + totalPrice); } }...
View Full Document

This note was uploaded on 12/07/2011 for the course BUS 350 taught by Professor Leighjin during the Fall '11 term at S.F. State.

Ask a homework question - tutors are online