Question

In: Computer Science

- Delcare variable data type as decimal (5 variables needed) count, price, subtotal, tax, total -...

- Delcare variable data type as decimal (5 variables needed) count, price, subtotal, tax, total

- Write a do while loop, if the price is not -1, loop continues show count number enter price get subtotal increase count

- Calculate tax, total

- Display total count, subtotal, tax, total

Solutions

Expert Solution

Note:

Could you please check the output.Any modifications needed let me know.Thank you.

_________________

#include <iostream>
using namespace std;

int main()
{
  
   //Declaring variables
double count=0.0,price,subtotal=0.0,tax,total;

//Getting the price entered by the user
   cout<<"Enter price : $";
   cin>>price;
   /* if the first price entered by the user
       * is equal to -1 .then program exit
       */
   if(price==-1)
   {
       exit(0);
       cout<<":: Program Exit ::"<<endl;
       }
do
{
   //Displaying the count value
   cout<<"Count :"<<++count<<endl;
  
   //calculating the subtotal
   subtotal+=price;
  
   //getting the price
cout<<"Enter price : $";
   cin>>price;   
  
   }while(price!=-1);
  
   //Calculating the tax
   tax=subtotal*0.05;
  
   //calculating the total
   total=subtotal+tax;
  
   //displaying the output
   cout<<"\nTotal Count ="<<count<<endl;
   cout<<"Subtotal = $"<<subtotal<<endl;
   cout<<"Tax = $"<<tax<<endl;
   cout<<"Total = $"<<total<<endl;
return 0;
}

______________________

Output:

___________Thank You


Related Solutions

reate a C# program. -Create 5 variables as decimals: Count, pricce, subtotal, tax, and total -Use...
reate a C# program. -Create 5 variables as decimals: Count, pricce, subtotal, tax, and total -Use a do while loop. If the price is not -1, the loop continues. Show count number (ie: Item 1, Item 2, Item 3...) Enter price Get subtotal Increase count -Calculate tax(0.035%) and total Show total count, subtotal, tax,and total Output: Item1: $2.00 Item2:: $3.00 Item3: $1.00 Item4: $-2 (Note: A negative number will not be substracted. It will only be ignored) There are 3...
Identify the variables in the raw data and indicate the type of each variable (i.e., nominal,...
Identify the variables in the raw data and indicate the type of each variable (i.e., nominal, ordinal, count or continuous; don’t worry about distinguishing ratio versus interval). Assume for this purpose that all the observations for a given paper plane are recorded in a single row. Variables : Design, Material, Maker, Thrower, Distance Type: ?
ABC Company estimates the following data for the coming month: total variable costs $60,000.00, income tax...
ABC Company estimates the following data for the coming month: total variable costs $60,000.00, income tax rate 30%, contribution margin percentage 60%. Find the estimated total sales for the coming month. a. $100,000 A GUESS b. $60,000 / 40% c. $60,000 / 60% d. $60,000 X 60% Type or paste question here
1 For each of the following variables, identify the type of variable (numeric or categorical) and...
1 For each of the following variables, identify the type of variable (numeric or categorical) and level of measurement (nominal, ordinal, interval, or ratio). a. Business size (micro, small, medium, large) b. Airplane ticket price 2 Consider the following sample of data: 1.2 28.4 32.6 17.0 13.5 2.2 38.0 41.4 1.9 14.4 21.8 23.8 a. Calculate the quartiles. b. Calculate the average c. Calculate the standard deviation. 3  Given the following five-number summary, are there any outliers in the data? Min:...
What data type should be used to store a count of items in a shopping cart?...
What data type should be used to store a count of items in a shopping cart? Select one: a. int b. String c. double d. char e. boolean What data type should be used to store the dollar amount in a shopping cart? Select one: a. boolean b. char c. String d. int e. double
Exercise 5-13 Changes in Selling Price, Sales Volume, Variable Cost per Unit, and Total Fixed Costs...
Exercise 5-13 Changes in Selling Price, Sales Volume, Variable Cost per Unit, and Total Fixed Costs [LO5-1, LO5-4] Miller Company’s contribution format income statement for the most recent month is shown below: Total Per Unit Sales (36,000 units) $ 252,000 $ 7.00 Variable expenses 144,000 4.00 Contribution margin 108,000 $ 3.00 Fixed expenses 49,000 Net operating income $ 59,000 Required: (Consider each case independently): 1. What is the revised net operating income if unit sales increase by 15%? 2. What...
Consider the following data for a dependent variable and two independent variables, and . x1= 30...
Consider the following data for a dependent variable and two independent variables, and . x1= 30 46 24 50 41 51 74 36 60 77. x2 = 13 11 17 17 6 20 8 12 13 16. y = 95 109 112 178 94 176 170 117 142 212 Round your all answers to two decimal places. Enter negative values as negative numbers, if necessary. a. Develop an estimated regression equation relating to y to x1 . Predict y if...
For the following description of​ data, identify the​ W's, name the​ variables, specify for each variable...
For the following description of​ data, identify the​ W's, name the​ variables, specify for each variable whether its use indicates it should be treated as categorical or​quantitative, and for any quantitative variable identify the units in which it was measured​ (or note that they were not​ provided). Specify whether the data come from a designed survey or experiment. Are the variables time series or​ cross-sectional? Report any concerns you have as well. An electronics manufacturerelectronics manufacturer wants to know what...
For the following description of​ data, identify the​ W's, name the​ variables, specify for each variable...
For the following description of​ data, identify the​ W's, name the​ variables, specify for each variable whether its use indicates it should be treated as categorical or quantitative and for any quantitative variable identify the units in which it was measured. Determine if the data comes from a designed survey or experiment. Determine if the variables are time series or​ cross-sectional. A company surveyed a random sample of 65006500 employees in the region. One question they asked​ was, "If your...
For the following description of​ data, identify the​ W's, name the​ variables, specify for each variable...
For the following description of​ data, identify the​ W's, name the​ variables, specify for each variable whether its use indicates it should be treated as categorical or​ quantitative, and for any quantitative variable identify the units in which it was measured​ (or note that they were not​ provided). Specify whether the data come from a designed survey or experiment. Are the variables time series or​ cross-sectional? Report any concerns you have as well. A certain horse race has been run...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT