Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int copiesSold;
  9. double netPrice;
  10. double royaltyOption1;
  11. double royaltyOption2;
  12. double royaltyOption3;
  13.  
  14. cout << "Sean Lamb\t" << "Ch04-Ex16\t"
  15. << "Ch04-Ex16.exe\n" << endl;
  16.  
  17. cout << "Enter the number of copies sold: ";
  18. cin >> copiesSold;
  19. cout << endl;
  20.  
  21. cout << "\n\nEnter the net price of one book: $";
  22. cin >> netPrice;
  23. cout << endl;
  24.  
  25.  
  26.  
  27. royaltyOption1 = 5000 + 20000;
  28. royaltyOption2 = (copiesSold*netPrice)*1.125;
  29. royaltyOption3 =
  30.  
  31. //else
  32. //royaltyOption3 = ((copiesSold*netPrice)1.14);
  33.  
  34. cout << "____ is the best and the royalty is: $";
  35. if (royaltyOption1 > royaltyOption2 && royaltyOption1 > royaltyOption3)
  36. {
  37. cout << royaltyOption1 << " is the best and the royalty is: $" << royaltyOption1;
  38. }
  39. else if (royaltyOption2 > royaltyOption1 && royaltyOption2 > royaltyOption3)
  40. {
  41. cout << royaltyOption2 << " is the best and the royalty is: $" << royaltyOption2;
  42. }
  43. else if (royaltyOption3 > royaltyOption1 && royaltyOption3 > royaltyOption2)
  44. {
  45. cout << royaltyOption3 << " is the best and the royalty is: $" << royaltyOption3;
  46.  
  47. }
  48.  
  49. cout << "\nRoyalty Option1: $" << royaltyOption1;
  50. cout << "\nRoyalty Option2: $" << royaltyOption2;
  51.  
  52. return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement