Question
Code in c++ please
Q1: Software Sales A software company sells a package that retails for $99. Quantity discounts are given according to the following table: QuantityDiscount 10-19 20-49 50-99 100 or more 20% 30% 40% 50% : Write a program that asks for the number of units sold and computes the total cost of the purchase. Input validation: Make sure the number of units is greater than 0. Q2: Book Club Points Community Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as ollows -If a customer purchases O books, O points are earned. -If a customer purchases 1 book, S points are earned. -If a customer purchases 2 books, 15 points are earned. -If a customer purchases 3 books, 30 points are earned. -If a customer purchases 4 or more books, 60 points are earned. Write a program that asks the user to enter the number of books that he or she has purchased this month and then display the number of points awarded.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Q1.solution:-

Source code:-

#include<iostream>

#include<iomanip>

using namespace std;

int main()

{

cout << "\n**************\n"

<< " Software Sales"

<< "\n**************\n\n";

int units;

double subtotal, total;

cout << "Enter number of units sold: ";

cin >> units;

cout << setprecision(2) << fixed;

if(units > 0 && units < 10)

{

total = units * 99;

cout << "The total is: $" << total << "\n\n";

}

else

{

if(units >= 10 && units <= 19)

{

subtotal = (units * 99) * 0.20;

total = (units * 99) - subtotal;

cout << "The total is: $" << total << "\n\n";

}

else

{

if(units >= 20 && units <=49)

{

subtotal = (units * 99) * 0.30;

total = (units * 99) - subtotal;

cout << "The total is: $" << total << "\n\n";

}

else

{

if(units >= 50 && units <= 99)

{

subtotal = (units * 99) * 0.40;

total = (units * 99) - subtotal;

cout << "The total is: $" << total << "\n\n";

}

else

{

if(units >= 100)

{

subtotal = (units * 99) * 0.50;

total = (units * 99) - subtotal;

cout << "The total is: $" << total << "\n\n";

}

else

{

cout << "The number of units has to be greater than 0!! \n\n";

}

}

}

}

}

system("pause");

return 0;

}

Q2.Solution:-

source code:-

#include<iostream>

using namespace std;

int main()

{

int books, points;

cout << "\**************\n"

<< " Book Club Points"

<< "\n*****************\n\n";

cout << "Enter the number of books purchased this month: ";

cin >> books;

if(books == 0)

{

points = 0;

cout << "You have earned: " << points << " points \n\n";

}

if(books == 1)

{

points = 5;

cout << "You have earned: " << points << " points \n\n";

}

if(books == 2)

{

points = 15;

cout << "You have earned: " << points << " points \n\n";

}

if(books == 3)

{

points = 30;

cout << "You have earned: " << points << " points \n\n";

}

if(books >= 4)

{

points = 60;

cout << "You have earned: " << points << " points \n\n";

}

else

{

if(books < 0)

cout << "Number of books cannot be negative!! \n\n";

}

system("pause");

return 0;

}

Add a comment
Know the answer?
Add Answer to:
Code in c++ please Q1: Software Sales A software company sells a package that retails for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Python 11. Book Club Points Serendipity Booksellers has a book club that awards points to its...

    Python 11. Book Club Points Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows: If a customer purchases 0 books, he or she earns 0 points If a customer purchases 2 books, he or she earns 5 points. O If a customer purchases 4 books, he or she earns 15 points If a customer purchases 6 books, he or she earns 30...

  • Visual Studio and Visual Basic program b. Serendipity Booksellers has a book club that awards points...

    Visual Studio and Visual Basic program b. Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows: If a customer purchases no books, he or she earns 0 points. If a customer purchases 1 book, he or she earns 5 points. If a customer purchases 2 book, he or she earns 15 points. If a customer purchases 3 book, he or she earns...

  • Please solve the following in Python 3 only. Also, share code and show output. A software...

    Please solve the following in Python 3 only. Also, share code and show output. 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 program that asks for the number of units sold and computes the total cost of the purchase. Input Validation: Make sure the number of units is greater than 0.

  • Directions: Complete all the three programming assignments below. Please be sure to follow the programming rubric...

    Directions: Complete all the three programming assignments below. Please be sure to follow the programming rubric provided. Turn in three separate “.py" files. Be sure to run your programs before submission. Color Mixer The colors red, blue, and yellow are called primary colors, because they cannot be made by mixing other colors. When you mix two primary colors, you get a secondary color, as shown here: • When you mix red and blue, you get purple. • When you mix...

  • Part II – Cost Calculator (15 Points) A software company sells a package that retails for...

    Part II – Cost Calculator (15 Points) A software company sells a package that retails for $ 99. Quantity discounts are given according to the following table: Quantity Discount 10 to 19 20% 20 to 49 30% 50 to 99 40% 100 or more 50% Write a program that asks the user to enter the number of packages purchased. The program should then display the discount percentage, amount of the discount (can be 0) and the total amount of the...

  • Computer science help! A software company sells their software packages for $99.00 each. They would like...

    Computer science help! A software company sells their software packages for $99.00 each. They would like you to write a program that will calculate and display an invoice for their customers. Quantity discounts are given according to the following table: Quantity   Discount 1 - 9 No discount 10 – 19 20% 20 – 49 30% 50 - 99 40% 100 or more 50% Write a C++ program that asks for the customer’s name and the number of software packages sold...

  • Q4 130 Quantity discounts are given according to the following table O points) A software company...

    Q4 130 Quantity discounts are given according to the following table O points) A software company sells one software package regularly for 99 QR Quantity Discount 20% 10-19 20-49 50-99 |00 or more 40% 50% write ρ program that asks for the number of items sold, and computes the total cost of the purchase. if the user enters an invalid number of items, the program displays invalid Purchasel" message. Sample output Enter number of items: 25 Total cost is 1732.5...

  • <Program 1: 50 points> software.cpp A software company sells a package that retails for $99. Quantity...

    <Program 1: 50 points> software.cpp 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 program that asks for today's date (you MUST use cin >> date. Do not use getline(cin, date)), the company name and the quantity they wish to buy and computes the total cost of the purchase. If the user enters a negative value...

  • An software company has three different promotion plans for its software purchase: plan A: each software...

    An software company has three different promotion plans for its software purchase: plan A: each software package is 49.99 if it is less than 50 packages. plan B: each software package is 44.99 if it is over 50 but less than 100 packages. plan C: each software package is 39.99 if it is over 100 packages. In addition, the customer will pay $4.99 per package as maintenance fee. For plan A, the customer gets 5% off per package in the...

  • Python Language 3. Shipping Charges The Fast Freight Shipping Company charges the following rates (per 500...

    Python Language 3. Shipping Charges The Fast Freight Shipping Company charges the following rates (per 500 miles shipped): 1. Number Guessing Game Write a program for players to guess the number that the program randomly generated. Your program should randomly generate an integer between 1 and 10. After a player guessing a number, your program should display "Too small", "Too large", or "That's it!". Weight of Package (in Kilograms) 2 kg or less Over 2 kg but not more than...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT