Question

In C++

Write a program to calculate a car dealers sale of the same car. Enter the car price and the number of cars sold. Calculate

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

int main()
{
   double price, tax, shippingCharge, totalPrice;
   int n;
   
   cout<<"Enter car price: ";
   cin>>price;
   
   cout<<"Enter number of cars: ";
   cin>>n;
   
   tax = price*0.09;
   shippingCharge = 3000;
   
   totalPrice = n*(price+tax+shippingCharge);
   
   cout<<"Total price of the car sale = "<<totalPrice<<endl;
   
   
    return 0;
}

Output:

Enter car price: 5000 Enter number of cars: 3 Total price of the car sale = 25350

Note: Please comment below if you have any doubts

Add a comment
Know the answer?
Add Answer to:
In C++ Write a program to calculate a car dealer's sale of the same car. Enter...
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
  • Write a C++ program that will calculate the total amount of money for book sales at...

    Write a C++ program that will calculate the total amount of money for book sales at an online store. For each sale, your program should ask the number of books sold and then the price for each book and the shipping method (‘S’ for standard shipping and ‘E’ for expedited shipping). The program will produce a bill showing the subtotal, the sales tax, the discount, the shipping charge, and the final total for the sale. The program will continue processing...

  • Write a program that asks the user to enter the types of dark chocolate and the...

    Write a program that asks the user to enter the types of dark chocolate and the number of packages purchased at the SHSU@ACM freshly made store. Make sure that you display the following chart for the user to make the selection. The plain base chocolate cost $5.00. The flavor and sweetness can be added to add on various rate. Chocolate Intensity Percentage                   Flavor & Sweetness              Cost Rate             1 - 25%                                               Super Sweet                            10% 26 - 50%        ...

  • In Java, write a program that will ask the user to enter the amount of a...

    In Java, write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 4 percent and the county sales tax is 2 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase...

  • Track tickets to digital point of sale system, design and build that point of sale program...

    Track tickets to digital point of sale system, design and build that point of sale program for them. Please help due very soon! 1. Allow the waitstaff to input the table number, and the number of diners at this table o Each table can seat up to 4 diners 2. For each diner at the table, the system must: 1. Display a menu of at least 7 common breakfast items 2. Allow the waitstaff to enter the items the diner...

  • need help!! c++ HW_6b - Calculate the average Use a do-while loop Write a program that...

    need help!! c++ HW_6b - Calculate the average Use a do-while loop Write a program that first prompts the user for an upper limit: Enter the number of entries: 5 € (user enters 5) After the user enters a number, the program should prompt the user to enter that many numbers. For example, if the user enters 5, then the program will ask the user to enter 5 values. Use a do-while loop to add the numbers. o With each...

  • Answer using C++ Write a program that will calculate the final sales price of a motorcycle;...

    Answer using C++ Write a program that will calculate the final sales price of a motorcycle; this includes additional optional packages along with sales tax. You may assume that the base? price of the motorcycle is $30,000. First you must ask the user to choose which optional packages they want. The user is only permitted to choose one package. Your program should display a menu of the available packages. The user should enter the package by entering the letter associated...

  • Python Code Write a program using functions and mainline logic which prompts the user to enter...

    Python Code Write a program using functions and mainline logic which prompts the user to enter a number. The number must be at least 5 and at most 20. (In other words, between 5 and 20, inclusive.) The program then generates that number of random integers and stores them in a list. The random integers should range from 0 to 100. (You can use a wider range if you want, but the lower end of the range must be at...

  • Write a program that processes the data of three car dealerships. ID    &nb...

    Write a program that processes the data of three car dealerships. ID           Name   Number   Price   Sales ------------------------------------------------------- 1001         CarMax     192 17000     0.0 1002     AutoNation     151   16000     0.0 1003   Group-1-Auto      166   15000     0.0 Define a data type of Dealer using struct, with the following members: ID, name, number of cars sold, price of a car, and total sales. In the main function, declare an array of Dealer, and initialize it with the data above. Design a function, compSales, to calculate the...

  • C program help: Write a C program that uses three functions to perform the following tasks:...

    C program help: Write a C program that uses three functions to perform the following tasks: – The first function should read the price of an item sold at a grocery store together with the quantity from the user and return all the values to main(). example: #include void getInput(int *pNum1, int *pNum2); // note: *pNum1 & *pNum2 are pointers to ints int main () {    int numDucks,numCats;    getInput(&numDucks, &numCats); // passing addresses of num1 & num2 to...

  • Your instructor would like you to write a program in Java which would ask for the clerk to enter ...

    Your instructor would like you to write a program in Java which would ask for the clerk to enter the total amount of the customer’s order. The program will then calculate a seven percent (7%) sales tax. Commission is computed based on the following: order amount id="mce_marker" - $200 commission is 2%, order amount $201 - $400 commission is 3%, order amount $401 - $600 commission is 4%, order amount > $600 commission is 5%, The program will display the...

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