Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- double DVD = 14.99;
- double standardDelivery = 3.99;
- double superfastDelivery = 12.99;
- double perDVD = .99;
- System.out.println("How many DVDs do you desire?");
- int amountofDVD = IO.readInt();
- double amountofDVD1 =
- System.out.println("Do you desire fast delivery? (True=yes, False=no)");
- boolean desirefastDelivery = IO.readBoolean();
- if (amountofDVD <= 0)
- {
- IO.reportBadInput();
- System.out.println("Return to shopping.");
- return;
- }
- else if (amountofDVD>=7)
- {
- if (desirefastDelivery == true)
- {
- System.out.println("Your total is:");
- double fullPrice = (amountofDVD*DVD +amountofDVD*perDVD)+superfastDelivery+(4.99*amountofDVD);
- System.out.println(fullPrice);
- IO.outputDoubleAnswer(fullPrice);
- }
- else
- {
- System.out.println("Congratulations! You've won free standard shipping! Your total is:");
- double fullPrice = (amountofDVD*DVD +amountofDVD*perDVD);
- System.out.println(fullPrice);
- IO.outputDoubleAnswer(fullPrice);
- }
- }
- else
- {
- if (desirefastDelivery == true)
- {
- System.out.println("Your total is:");
- double fullPrice = (amountofDVD*DVD + amountofDVD*perDVD)+superfastDelivery+(4.99*amountofDVD);
- System.out.println(fullPrice);
- IO.outputDoubleAnswer(fullPrice);
- }
- else
- {
- System.out.println("Your total is:");
- double fullPrice = (amountofDVD*DVD + amountofDVD*perDVD)+standardDelivery;
- System.out.println(fullPrice);
- IO.outputDoubleAnswer(fullPrice);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement