Question

In: Computer Science

A local T-shirt company is running a promotion as follows: For customers that buy less than...

A local T-shirt company is running a promotion as follows: For customers that buy less than 5 TShirts, there is no disconut. If a customer buys: between 6 and 10 Tshirts they get 10% discount. between 11 and 20 TShirts they get 20% discount. between 21 and 100 TShirts they get 50% discount. Write a C++ program that prompts the user for a number of TShirts. Assuming that a TShirt costs $10, calculate the appropriate discounts and display the number of TShirts bought, total amount, discount amount, and total amount due. For example, if the user bought 11 TShirts, the program should display the following: Number of TShirts bought: 11 Total amount : $ 110 Discount amount : $ 22 Total amount due : $ 88 If the user enters negative values or a 0 for number ofTshirts display an error message and ask them to run the program again.

Solutions

Expert Solution

Check the above images.

Its an image of handwritten program for the question.

#include<iostream>
using namespace std;
int main( )
{
int n, total, dis;
cout<<"Enter no. of shirts:\n";
cin>>n;
if(n<=0)
     cout<<"error";
else if((n>1)&&(n<=5))
      {
        dis=0;
        total=50;
        goto display;
      }
   else if((n>=6)&&n<=10)
     {
       dis=(n*10*10)/100;
       total=n*10;
       goto display;
     }
   else if((n>=11)&&(n<=20))
     {
        total=n*10;
        dis=(n*10*20)/100;
        goto display;
      }
    else if((n>=21)&&(n<=100))
      {
        total=n*10;
        dis=(n*10*50)/100;
       }
display:
               int due= total-dis;
               cout<<"Total amount=$"<<total;
               cout<<"\nDiscount amount =$"<<dis;
                cout<<"\n Total amount due=$"<<due;
return 0;
}


Related Solutions

Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The sales manager has provided a sales forecast for the coming year, along with the following information:Quarter 1Quarter 2Quarter 3Quarter 4  Budgeted Unit Sales32,00052,00026,00052,000         Each T-shirt is expected to sell for $20.The purchasing manager buys the T-shirts for $8 each.The company needs to have enough T-shirts on hand at the end of each quarter to fill 30 percent of the next quarter’s sales demand.Selling and administrative expenses...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The sales manager has provided a sales forecast for the coming year, along with the following information:        Quarter 1 Quarter 2 Quarter 3 Quarter 4   Budgeted Unit Sales 40,000 60,000 30,000 60,000         •    Each T-shirt is expected to sell for $15. •    The purchasing manager buys the T-shirts for $6 each. • The company needs to have enough T-shirts...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The sales manager has provided a sales forecast for the coming year, along with the following information: Quarter 1 Quarter 2 Quarter 3 Quarter 4 Budgeted Unit Sales 42,000 64,000 32,000 64,000 Each T-shirt is expected to sell for $17. The purchasing manager buys the T-shirts for $7 each. The company needs to have enough T-shirts on hand at the end of each quarter to...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The sales manager has provided a sales forecast for the coming year, along with the following information: Budgeted Unit Sales Quarter 1 47,000 Quarter 2 74,000 Quarter 3 37,000 Quarter 4 74,000 Each T-shirt is expected to sell for $22. The purchasing manager buys the T-shirts for $9 each. The company needs to have enough T-shirts on hand at the end of each quarter to...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The sales manager has provided a sales forecast for the coming year, along with the following information: Quarter 1 Quarter 2 Quarter 3 Quarter 4 Budgeted unit sales 50,000 80,000 40,000 80,000 Each T-shirt is expected to sell for $25. The purchasing manager buys the T-shirts for $10 each. The company needs to have enough T-shirts on hand at the end of each quarter to...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The sales manager has provided a sales forecast for the coming year, along with the following information: Quarter 1 Quarter 2 Quarter 3 Quarter 4 Budgeted Unit Sales 49,000 78,000 39,000 78,000 Each T-shirt is expected to sell for $24. The purchasing manager buys the T-shirts for $10 each. The company needs to have enough T-shirts on hand at the end of each quarter to...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The sales manager has provided a sales forecast for the coming year, along with the following information: Quarter 1-49000, Quarter 2-78000, Quarter 3- 39000 Quarter 478000 Budgeted Unit Sales. Each T-shirt is expected to sell for $24. The purchasing manager buys the T-shirts for $10 each. The company needs to have enough T-shirts on hand at the end of each quarter to fill 34 percent...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The sales manager has provided a sales forecast for the coming year, along with the following information: Quarter 1 Quarter 2 Quarter 3 Quarter 4 Budgeted Unit Sales 41,000 62,000 31,000 62,000 Each T-shirt is expected to sell for $16. The purchasing manager buys the T-shirts for $6 each. The company needs to have enough T-shirts on hand at the end of each quarter to...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The sales manager has provided a sales forecast for the coming year, along with the following information: Quarter 1 Quarter 2 Quarter 3 Quarter 4 Budgeted unit sales 48,000 76,000 38,000 76,000 Each T-shirt is expected to sell for $23. The purchasing manager buys the T-shirts for $9 each. The company needs to have enough T-shirts on hand at the end of each quarter to...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The...
Red Canyon T-shirt Company operates a chain of T-shirt shops in the southwestern United States. The sales manager has provided a sales forecast for the coming year, along with the following information: Quarter 1 Quarter 2 Quarter 3 Quarter 4 Budgeted Unit Sales 36,000 56,000 28,000 56,000 Each T-shirt is expected to sell for $11. The purchasing manager buys the T-shirts for $4 each. The company needs to have enough T-shirts on hand at the end of each quarter to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT