Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. printf("A to AdditionnD to Descountn");
  2. scanf("%c", &switchChoose);
  3.  
  4. switch (switchChoose) {
  5. case 'A':
  6. printf("Entering case A...n");
  7. printf("Enter product price:n");
  8. scanf("%f", &productPrice);
  9.  
  10. reajustedPrice = productPrice + (productPrice * (percentageValue / 100));
  11. printf("Total price: %.2f", reajustedPrice);
  12. break;
  13.  
  14. case 'D':
  15. printf("Entering case D...n");
  16. printf("Enter product price:n");
  17. scanf("%f", &productPrice);
  18.  
  19. reajustedPrice = productPrice - (productPrice * (percentageValue / 100));
  20. printf("Total price: %.2f", reajustedPrice);
  21. break;
  22. }
  23.  
  24. switch (switchChoose) {
  25. case 'A':
  26. printf("Entering case A...n");
  27. printf("Enter product price:n");
  28. scanf("%f", &productPrice);
  29.  
  30. reajustedPrice = productPrice + (productPrice * 0.03);
  31. printf("Total price: %.2f", reajustedPrice);
  32. break;
  33.  
  34. case 'D':
  35. printf("Entering case D...n");
  36. printf("Enter product price:n");
  37. scanf("%f", &productPrice);
  38.  
  39. reajustedPrice = productPrice - (productPrice * 0.03);
  40. printf("Total price: %.2f", reajustedPrice);
  41. break;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement