A software company sells a package that retails for $99- Quantity disc.docx
A software company sells a package that retails for $99- Quantity disc.docx
Upcoming SlideShare
Write a program that asks the user to enter the number of packages pur.docxWrite a program that asks the user to enter the number of packages pur.docx
Loading in ... 3
1 of 2

More Related Content

More from mrichard5(20)

A software company sells a package that retails for $99- Quantity disc.docx

  1. A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10-19 20% 20-49 30% 50-99 40% 100 or more 50% Write a c++ program that asks for the number of units purchased and computes the total cost of the purchase. Solution #include <iostream> using namespace std; int main () { int units; float totalCost; cout << "Please enter the number of units purchased : "; cin >> units; if((units >= 10) && (units <= 19)){ totalCost = (99 * units) - ((99 * units * 20)/100); cout<<"Total Cost : " << totalCost; } else if((units >= 20) && (units <= 49)){ totalCost = (99 * units) - ((99 * units * 30)/100); cout<<"Total Cost : " << totalCost;
  2. } else if((units >= 50) && (units <= 99)){ totalCost = (99 * units) - ((99 * units * 40)/100); cout<<"Total Cost : " << totalCost; } else if(units >= 100){ totalCost = (99 * units) - ((99 * units * 50)/100); cout<<"Total Cost : " << totalCost; } else{ totalCost = 99 * units; cout<<"Total Cost : " << totalCost; } return 0; }