Question

An electronic game developer company offers discount depending on the quantities ordered. This month"iDevelop" gmae is...

An electronic game developer company offers discount depending on the quantities ordered.

This month"iDevelop" gmae is being princed at 20. Client companies are restricted to order a minimum of 5 to maximum of 10 games

Quantity discounts are given according to the following table

Quantity discount Rate

5 8%

6 10%

7 12%

8 15%

9 17%

10 20%

the app asks the user to provide the company name and to select the number of

games he/she wants to purchase and then display

the amount of the discount=price *quantity *discount rate)

and the total cost of the purchase(total cost=price * quntity-discount)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>

using namespace std;

int findDiscount(int quantity) {
    if(quantity == 5) {
        return 8;
    }
    if(quantity == 6) {
        return 10;
    }
    if(quantity == 7) {
        return 12;
    }
    if(quantity == 8) {
        return 15;
    }
    if(quantity == 9) {
        return 17;
    }
    if(quantity == 10) {
        return 20;
    }
    return 0;
}
int main() {
    string name;
    int q;

    cout << "Enter company: ";
    cin >> name;

    cout << "Enter number of games purchased: ";
    cin >> q;
    while(q < 5 || q > 10) {
        cout << "invalid quantity. try again." << endl;
        cout << "Enter number of games purchased: ";
        cin >> q;
    }

    int discount_perc = findDiscount(q);

    double amount_discount = q * 20 * discount_perc / 100;
    double cost_purchase = q * 20 - amount_discount;

    cout << "Total discount: " << amount_discount << endl;
    cout << "Cost of purchase: " << cost_purchase << endl;
}

Please upvote, as i have given the exact answer as asked in question. Still in case of any concerns in code, let me know in comments. Thanks!

Add a comment
Know the answer?
Add Answer to:
An electronic game developer company offers discount depending on the quantities ordered. This month"iDevelop" gmae is...
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
  • Jasper Company is a wholesaler that buys merchandise in large quantities. Its supplier’s catalog indicates a...

    Jasper Company is a wholesaler that buys merchandise in large quantities. Its supplier’s catalog indicates a list price of $500 per unit on merchandise Jasper intends to purchase, and offers a 30% trade discount for large quantity purchases. The cost of shipping for the merchandise is $7 per unit. Jasper’s total purchase price per unit will be:

  • excel for accounting Buckeye Company sells three products and offers quantity discounts to the customers. Buckeye...

    excel for accounting Buckeye Company sells three products and offers quantity discounts to the customers. Buckeye Company wants you to make a worksheet that will allow the salesperson (the user) to input the item and the quantity of the item that their customer wants to purchase. The worksheet will then calculate a price quote that the salesperson can give to the customer. The three products and the selling price are as follows: Item Unit Price Portable hard drive $99.00 Thumb...

  • 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...

  • Suppose that a company offers quantity discounts. If up to 1000 units are purchased, the unit...

    Suppose that a company offers quantity discounts. If up to 1000 units are purchased, the unit price is $10; if more than 1000 and up to 5000 units are purchased, the unit price is $9; and if more than 5000 units are purchased, the unit price is $7.50. Develop a spreadsheet using the VLOOKUP function to find the unit price associated with any or-der quantity and compute the total cost of the order. S&S No. 106 INVOICE Customer G. Kite...

  • 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...

  • I'm having trouble figuring out the C++ code for the following assignment, keep getting errors. Help?...

    I'm having trouble figuring out the C++ code for the following assignment, keep getting errors. Help? Write a program that calculates a discount for buying certain quantities of coffee. Consider the following scenario: A coffee company sells a pound of coffee for $12.99. Quantity discounts are given according to the table below. Quantity Discount 5-9 5% 10-19 10% 20-29 15% 30 or more 20% Write a program that asks for the number of pounds purchased and computes the total cost...

  • 55-16 Sowed Help Save & Exit TB MC Qu. 04-102 Jasper Company is a wholesaler that......

    55-16 Sowed Help Save & Exit TB MC Qu. 04-102 Jasper Company is a wholesaler that... Jasper Company is a wholesaler that buys merchandise in large quantities. Its supplier's catalog indicates a list price of $500 per unit on merchandise Jasper intends to purchase. offers a 30% trade discount for large quantity purchases. The cost of shipping for the merchandise is $7 per unit. Jasper's total purchase price per unit will be: Multiple Choice $507 O $350 O $352 O...

  • The Kuantan Corporation purchases a component from a supplier who offers quantity discounts to encourage larger...

    The Kuantan Corporation purchases a component from a supplier who offers quantity discounts to encourage larger order quantities. The supply chain manager of the company wants to determine the optimal order quantity to ensure the total annual inventory cost is minimized. The company’s annual demand forecast for the item is 4,550 units, the order cost is $25 per order, and the annual holding rate is 12 percent. The price schedule for the item is: Order Quantity Price per Unit ($)...

  • 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...

  • Question Set 2. MUSTBE DONE USING EXCEL operation must periodically purchase bulk quantities of b...

    Question Set 2. MUSTBE DONE USING EXCEL operation must periodically purchase bulk quantities of bolts. The bolts are purchased in manu boxes of 500 and are consumed at a constant rate. The operation expects to purchase 30,000 boxes over the coming year. Each box costs $150, the annual holding cost per box is $20, and the cost of placing an order is $240 (regardless of the quantity ordered). For the following questions, use the basic economic order quantity model (without...

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