Guest User

Untitled

a guest
Oct 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. if ((quantity>=25) && (quantity<=50) && (choice=='y') || (choice=='Y')) //don"t execute as expected when Y is input//
  2. {
  3. cost = quantity * 320 + MOULD; //MOULD is a constant, if the user input 'y' or 'Y' for yes, $3500 is added to cost
  4. discount = 0.0; // Discount is only given when quantity is over 50
  5. GCT = 0.165 * cost;
  6. total = cost + GCT;
  7. test= test+1; //Am printing a report a the end of the case so i use this to track is any conditions were met
  8. }
  9.  
  10. if ((quantity>50) && (choice=='y') || (choice=='Y'))
  11. {
  12. cost = quantity * 320 + MOULD;
  13. discount = cost * 0.05;
  14. Dis_Prize = cost - discount;
  15. GCT = 0.165 * Dis_Prize;
  16. total = Dis_Prize + GCT;
  17. test= test+1;
  18. }
  19. if ((quantity>=25) && (quantity<=50) && (choice=='n') || (choice=='N'))
  20. {
  21. cost = quantity * 320;
  22. discount = 0.0;
  23. GCT = 0.165 * cost;
  24. total = cost + GCT;
  25. test= test+1;
  26. }
  27. if((quantity>50) && (choice=='n') || (choice=='N'))
  28. {
  29. cost = quantity * 320;
  30. discount = cost * 0.05;
  31. Dis_Prize = cost - discount;
  32. GCT = 0.165 * Dis_Prize;
  33. total = Dis_Prize + GCT;
  34. test= test+1;
  35. }
  36. if ((choice!='y') && (choice!='Y') && (choice!='n') && (choice!='N'))
  37. {
  38. printf("THE OPTIONS FOR DESIGN IS EITHER YES(Y) OR NO (N)n");
  39. test = 0;
  40. }
  41. if (quantity < 25)
  42. {
  43. printf("YOU ARE NOT ALLOWED TO ORDER LESS THAN 25 SHIRTSn");
  44. test = 0;
  45. }
  46. break;
Add Comment
Please, Sign In to add comment