Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
699 B
34
Indexable
Never
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);
	}
}