For the following - I'm suppose to replace the first three statements with cin and cout statements so that the values for the age, salary, and distance_to_the_moon can be obtained from the user. This make the program flexible so that everytime is is run different numbers are used.
#include <iostream.h># comments appear at the top of the file indicating the assignment number question number and your name
void main(void)
{
int age = 32;
float salary = 25000.75;
long distance_to_the_moon = 238857;
cout << “The employee is “ << age << “ years old” << endl;
cout << “The employee makes $” << salary << endl;
cout << “The moon is “ << distance_to_the_moon <<
“ miles from the earth” << endl;
}
# the tax amount is a constant value of .085
# the user enters from the keyboard the cost
# a discount of 10% will be declared as a constant and given on the cost that was entered
# a new variable will be declared called new_cost and will be the cost minus the discount
# the tax will be figured out on the new_cost after the discount of 10% is taken off of the cost
# the total will be the new_cost plus the tax
# the user will enter the amount_paid from the keyboard
# the change will be the amount_paid minus the total
# and the cost, discount, new cost, tax, total, and amount_paid will all be printed with appropriate format.
# include <iostream.h>
void main()
{
float cost = 15.50; // The cost of an item
float sales_tax = 0.06; // Sales tax is 6 percent
float amount_paid = 20.00; //The amount the buyer paid
float tax, change, total; // Sales tax, buyer change and total bill
tax = cost * sales_tax;
total = cost + tax;
change =amount_paid – total;
cout << “Item Cost: $” << cost << “ Tax: $” << tax <<
“\tTotal: $” << total << endl;
cout << “Customer change: $” << change << endl;
}