Indentation exercise

Indentation exercise - discountRate = 0.3; } else if...

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

View Full Document Right Arrow Icon
/* * Indentation exercise */ package indentation; /** * * @author Manny */ public class Indentation { /** * @param args the command line arguments */ public static void main(String[] args) { int purchaseUnit = 5; double discountRate = 0; double unitPrice = 49.99; double discountedPrice = 0; double totalPrice = 0; if (purchaseUnit >= 10) {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: discountRate = 0.3; } else if (purchaseUnit >= 5) { discountRate = 0.2; } else { discountRate = 0.1; } discountedPrice = unitPrice * (1 - discountRate); totalPrice = discountedPrice * purchaseUnit; System.out.println("The total price is: " + totalPrice); } }...
View Full Document

Ask a homework question - tutors are online