Question

In: Computer Science

Plan for a solution by drawing a flowchart EFG Co wants you to develop a C++...

Plan for a solution by drawing a flowchart

EFG Co wants you to develop a C++ program to calculate the total invoice based on the user inputs item price and the quantity of the item purchased, taking into consideration the discount given for each category as follow:

  • Less than 10 Item: No discount
  • Between 10 and 20 items: 10 % off the item price
  • More than 20 items: 20% off the item price.

Solutions

Expert Solution

C++ PROGRAM

#include <iostream>

using namespace std;

int main()
{
  
int itemprice,quantity;
float total,temp;
cout<<"Enter item Price: ";
//reads input from user
cin>>itemprice;
  
cout<<"Enter Quantity: ";
//reads inout from user
cin>>quantity;
// calculates total
total = itemprice*quantity;
  
//checks the condition for Quantity
if(quantity<10)
{
cout<<"Total invoice: "<<total;
}
else if(quantity>=10 && quantity <=20)
{
//calculates the discount
temp = total/100;
temp = temp *10;
total = total - temp;
cout<<"Total invoice: "<<total;
}
else if(quantity>20)
{
//calculates the discount
temp = total/100;
temp = temp *20;
total = total - temp;
cout<<"Total invoice: "<<total;
}
  
return 0;
}

OUTPUT


Related Solutions

C++ program: ABC Co wants you to develop a C++ program to calculate the total invoice...
C++ program: ABC Co wants you to develop a C++ program to calculate the total invoice based on the user inputs item price and the quantity of the item purchased, taking into consideration the discount given for each category as follow: Less than 10 Item: No discount Between 10 and 20 items: 10 % off the item price More than 20 items: 20% off the item price. Your Program should display, the total before discount, how much discount and the...
Part C As a healthcare manager, you may be called upon to develop a compliance plan...
Part C As a healthcare manager, you may be called upon to develop a compliance plan for your healthcare organization. The office of inspector general suggests seven guiding principles/elements to be included in any compliance plan. These elements are presented in chapter 2 and reproduced below. Designation of a compliance officer and a compliance committee Development of compliance policies and procedures, including standard of conduct Developing open lines of communication Appropriate and education Internal monitoring and auditing Response to detected...
Elizabeth Burke wants to develop a model to more effectively plan production for the next year....
Elizabeth Burke wants to develop a model to more effectively plan production for the next year. Currently, PLE has a planned capacity of producing 9100 mowers each month, which is approximately the average monthly demand over the previous year. However, looking at the unit sales figure for the previous year, she observed that the demand for mowers has a seasonal fluctuation, so with this level production strategy there is over-production in some months, resulting in excess inventory buildup and underproduction...
Why should you develop an HRM strategic plan?
Why should you develop an HRM strategic plan?
You are to develop a risk management plan for the Pierce family. Your plan should incorporate...
You are to develop a risk management plan for the Pierce family. Your plan should incorporate insurance and noninsurance recommendations. Provide a complete explanation of your assumptions. Remember to make the work your own. Case facts: Joe, 37, self-employed carpenter, four employees, nets $60,000 per year Anita, 37, part-time nurse, earns $30,000 per year Children: Nathan (12), Isaac (10), Charlotte (6), Lydia (3) Assets, in $ Personal Cash 12,000 Mutual funds 8,000 IRAs 15,000 401(k) 28,000 Car 20,000 ATV 5,000...
Develop your Career Progression Plan Q1: Suppose you work as IT Officer in an organization, develop...
Develop your Career Progression Plan Q1: Suppose you work as IT Officer in an organization, develop your career plan, eveluate yourself according to your interest, ability, values, skills and personality. ( Not less than 500 words). No plagiaraism please, if so, no thumb up for the answer!
1.How do you develop a productivity improvement strategy? 2.How do you develop an implementation plan for...
1.How do you develop a productivity improvement strategy? 2.How do you develop an implementation plan for the strategy?
The assignment in this topic required you to develop a performance management plan for a hypothetical...
The assignment in this topic required you to develop a performance management plan for a hypothetical new allied care organization in your field. What regulatory standards will apply to your organization? What accreditation standards? How will these regulations affect the development of your plan, and what measures will you take to ensure your organization is in compliance?
Assume that you were hired as a cost accountant to develop a plan to implement the...
Assume that you were hired as a cost accountant to develop a plan to implement the Activity Based Costing system for one of these service organizations. Use a service company or government agency with a name that begins with the letter "T". Present an ABC system development plan, including detailed steps needed to effectively implement the system. Include a brief background on the organization’s main activities and services provided and your opinion on whether there will be any limitation on...
You will develop a nursing care plan for a person with a nutritional concern. choose a...
You will develop a nursing care plan for a person with a nutritional concern. choose a patient condition type Care plan for person with kidney disease nursing diagnose medical diagnose Pt. INICIAL Write up One priority nursing diagnosis. Subjective data:   Objective data:   Measurable Goal:   nursing interventions Evaluation:   #of intervention Rationale citation
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT