Question

Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more books and offers 2 free books wit

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <iostream>

using namespace std;

int main()
{
bool isPremium="TRUE"; //TRUE or FALSE depends on userType
int nbooksPurchased=0; //value is depends on user that how many books they purchase.
if(isPremium)
{
if(nbooksPurchased>=5 && nbooksPurchased<8)
{
nbooksPurchased+=1;
}
if(nbooksPurchased>=8)
{
nbooksPurchased+=2;
}
//print the final price
}
else
{
if(nbooksPurchased>=7 && nbooksPurchased<12)      
{
nbooksPurchased+=1;
}
if(nbooksPurchased>=12)
{
nbooksPurchased+=2;
}
//print the final price
}
return 0;
}

This is the required logic for given problem statement

Add a comment
Know the answer?
Add Answer to:
Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more...
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
  • Kane Candy Company offers a coffee mug as a premium for every ten $1 candy bar...

    Kane Candy Company offers a coffee mug as a premium for every ten $1 candy bar wrappers presented by customers together with $2. The purchase price of each mug to the company is $1.80; in addition it costs $1.20 to mail each mug. The results of the premium plan for the years 2017 and 2018 are as follows (assume all purchases and sales are for cash): 2017 2018 Coffee mugs purchased 730,000 820,000 Candy bars sold 5,700,000 6,720,000 Wrappers redeemed...

  • Kane Candy Company offers a coffee mug as a premium for every ten $1 candy bar...

    Kane Candy Company offers a coffee mug as a premium for every ten $1 candy bar wrappers presented by customers together with $2. The purchase price of each mug to the company is $1.80; in addition it costs $1.20 to mail each mug. The results of the premium plan for the years 2017 and 2018 are as follows (assume all purchases and sales are for cash): 2017 2018 Coffee mugs purchased 710,000 780,000 Candy bars sold 5,800,000 6,790,000 Wrappers redeemed...

  • Wildhorse Candy Company offers a coffee mug as a premium for every ten $1 candy bar...

    Wildhorse Candy Company offers a coffee mug as a premium for every ten $1 candy bar wrappers presented by customers together with $2. The purchase price of each mug to the company is $2.40; in addition it costs $1.60 to mail each mug. The results of the premium plan for the years 2020 and 2021 are as follows (assume all purchases and sales are for cash): 2020 2021 Coffee mugs purchased 750,000 780,000 Candy bars sold 5,500,000 6,690,000 Wrappers redeemed...

  • Stellar Company offers an MP3 download (seven-single medley) as a premium for every 5 candy bar...

    Stellar Company offers an MP3 download (seven-single medley) as a premium for every 5 candy bar wrappers presented by customers together with $2.55. The candy bars are sold by the company to distributors for 30 cents each. The purchase price of each download code to the company is $2.30. In addition, it costs 50 cents to distribute each code. The results of the premium plan for the years 2017 and 2018 are as follows. (All purchases and sales are for...

  • Pharoah Candy Company offers a coffee mug as a premium for every ten $1 candy bar...

    Pharoah Candy Company offers a coffee mug as a premium for every ten $1 candy bar wrappers presented by customers together with $2. The purchase price of each mug to the company is $2.40; in addition it costs $1.60 to mail each mug. The results of the premium plan for the years 2020 and 2021 are as follows (assume all purchases and sales are for cash): Coffee mugs purchased Candy bars sold Wrappers redeemed 2020 wrappers expected to be redeemed...

  • Crane Candy Company offers a coffee mug as a premium for every ten $1 candy bar...

    Crane Candy Company offers a coffee mug as a premium for every ten $1 candy bar wrappers presented by customers together with $2. The purchase price of each mug to the company is $2.40; in addition it costs $1.60 to mail each mug. The results of the premium plan for the years 2020 and 2021 are as follows (assume all purchases and sales are for cash): 2020 2021 Coffee mugs purchased 700,000 810,000 Candy bars sold 5,700,000 6,800,000 Wrappers redeemed...

  • Sarasota offers an MP3 download (seven-single medley) as a premium for every 5 candy bar wrappers...

    Sarasota offers an MP3 download (seven-single medley) as a premium for every 5 candy bar wrappers presented by customers together with $3.30. The candy bars are sold by the company to distributors for 30 cents each. The purchase price of each download code to the company is $3.05. In addition, it costs 50 cents to distribute each code. The results of the premium plan for the years 2020 and 2021 are as follows. (All purchases and sales are for cash.)...

  • review for the final 1. (1 point) Mark True or False in the left side of...

    review for the final 1. (1 point) Mark True or False in the left side of problems. (1) We can declare an array of string as string) greetings = {"good", "excellent"); (2) To declare and initialize an int variable i to be 2, we can write int=2; (3) For a properly declared and initialized int variable num, a condition to represent that num is between 10, 100) is written as (num >= 0 || num < 100). (4) Every nested...

  • Pharoah offers an MP3 download (seven-single medley) as a premium for every 6 candy bar wrappers...

    Pharoah offers an MP3 download (seven-single medley) as a premium for every 6 candy bar wrappers presented by customers together with $2.65. The candy bars are sold by the company to distributors for 30 cents each. The purchase price of each download code to the company is $2.40. In addition, it costs 50 cents to distribute each code. The results of the premium plan for the years 2020 and 2021 are as follows. All purchases and sales are for cash.)...

  • Write a C++ program that asks for the following information about a book order from the...

    Write a C++ program that asks for the following information about a book order from the console: • Title • Author • ISBN (hint: careful about what data type to use - validate 9 or 13 characters) • Price (validate number < 400) • Quantity (number of books to purchase – validate > 0 and < 100) • Fiction/Non-Fiction (‘N’ or ‘F’ - validate) • Genre (‘R’ romance, ‘D’ drama, ‘M’ mystery – validate) Make use of the following data...

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