115k views
2 votes
Create a program that will automatically add the fees and sales tax to a new car.Create a program to find the subtotal andd then total including sales tax. The program should receive a keyboard input representing the vale of the price of the car and the fees as well as the sales tax for the city the car is purchased in. San Francisco, Eurica, Concord California.

1 Answer

5 votes

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables

double price,fee,tax;

double total;

cout<<"enter the price of car:";

// read the price of car

cin>>price;

cout<<"enter the fee:";

// read the fee

cin>>fee;

cout<<"enter the tax (in %):";

// read the tax

cin>>tax;

a

// total cost

total=price+fee+(price*tax)/100;

// print the cost

cout<<"total cost is: "<<total<<endl;

return 0;

}

Step-by-step explanation:

Read the price of the car from user and assign it to variable "price",read fee and assign it to variable "fee" and tax to variable "tax".Then calculate the total cost of the car by adding the fee and tax of car to the price of car.

Output:

enter the price of car:1000

enter the fee:50

enter the tax (in %):10

total cost is: 1150

User Salah Alshaal
by
6.4k points