Untitled

 avatar
unknown
plain_text
3 years ago
699 B
37
Indexable
package lab;
import java.util.Scanner;
public class InputScanner {
	public static void main(String[] args) {
		
		System.out.println("Welcome to the Invoice Total Calculator"); 
		System.out.println(); 
		
		Scanner sc = new Scanner(System.in); 
		System.out.println("Enter subtotal: "); 
		double subtotal = sc.nextDouble(); 
		
		double discountPercent = .2; 
		double discountAmount = subtotal + discountPercent; 
		double invoiceTotal = subtotal - discountAmount; 
		
		String message = "Discount percent: " + discountPercent + "\n"  
						+ "Discount amount: " + discountAmount + "\n" 
						+ "Invoice total: " + invoiceTotal + "\n";
		System.out.println(message);
	}
}
Editor is loading...