Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. /**
  2. * @param args
  3. */
  4. public static void main(String[] args) {
  5. // TODO Auto-generated method stub
  6.  
  7. double DVD = 14.99;
  8. double standardDelivery = 3.99;
  9. double superfastDelivery = 12.99;
  10. double perDVD = .99;
  11. System.out.println("How many DVDs do you desire?");
  12. int amountofDVD = IO.readInt();
  13. double amountofDVD1 =
  14. System.out.println("Do you desire fast delivery? (True=yes, False=no)");
  15. boolean desirefastDelivery = IO.readBoolean();
  16.  
  17. if (amountofDVD <= 0)
  18. {
  19. IO.reportBadInput();
  20. System.out.println("Return to shopping.");
  21. return;
  22. }
  23. else if (amountofDVD>=7)
  24. {
  25. if (desirefastDelivery == true)
  26. {
  27. System.out.println("Your total is:");
  28. double fullPrice = (amountofDVD*DVD +amountofDVD*perDVD)+superfastDelivery+(4.99*amountofDVD);
  29. System.out.println(fullPrice);
  30. IO.outputDoubleAnswer(fullPrice);
  31. }
  32. else
  33. {
  34. System.out.println("Congratulations! You've won free standard shipping! Your total is:");
  35. double fullPrice = (amountofDVD*DVD +amountofDVD*perDVD);
  36. System.out.println(fullPrice);
  37. IO.outputDoubleAnswer(fullPrice);
  38. }
  39. }
  40. else
  41. {
  42. if (desirefastDelivery == true)
  43. {
  44. System.out.println("Your total is:");
  45. double fullPrice = (amountofDVD*DVD + amountofDVD*perDVD)+superfastDelivery+(4.99*amountofDVD);
  46. System.out.println(fullPrice);
  47. IO.outputDoubleAnswer(fullPrice);
  48. }
  49. else
  50. {
  51. System.out.println("Your total is:");
  52. double fullPrice = (amountofDVD*DVD + amountofDVD*perDVD)+standardDelivery;
  53. System.out.println(fullPrice);
  54. IO.outputDoubleAnswer(fullPrice);
  55. }
  56. }
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement