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?
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!
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
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 High Cholesterol Ethnic specific Hispanic Age specific: children, Geographic specific: urban, rural Write up One priority nursing diagnosis. Subjective data:   Objective data:   Measurable Goal:   nursing interventions Evaluation:   #of intervention Rationale citation
You will develop a program in C++ that will do a "find and replace" on an...
You will develop a program in C++ that will do a "find and replace" on an input file and write out the updated file with a new name. It will prompt your user for four inputs: The name of the input file. The characters to find in the input file. The replacement (substitute) characters. The name of the output file. It will perform the replacement. Note1: all instances must be replaced not just the first one on a line. Note2:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT