Question: (b) (20 points] Develop the C++ program of the pseudocode developed in 4. (a). The program should define the first name and last name in
(b) (20 points] Develop the C++ program of the pseudocode developed in 4. (a). The program should define the first name and last name in string variables, age in integer variable and weight in float variable. The name of the submitted program must be myinformation.cpp NOTE: Use valid and meaningful variable names or identifiers. Some Programming Hints: 1. Use cout to display the result or output on the screen. 2. Use cin to get the input from the user. Sample Run Enter your first name: Joe Enter your last name: Smith Enter your age (in years only): 25 - Enter your weight (in pounds): 112 - Greetings from me. My name is Joe Smith. My age is 25 and my weight is 112 pounds. b. [25 points] Develop the C++ program of the algorithm developed in 5. (a). The name of the submitted program must be restaurantBill.cpp. Some Programming Hints: 1. Use cout to display the result or output on the screen. 2. Use cin to get the input from the user. 3. The tax and tip will be constants for the program. Use const double for tax and tip. 4. The variables for tax amount, tip amount and total bill amount should be double. 5. The tax amount can be calculated by multiplying (*) the meal cost and the tax. 6. The tip amount can be calculated by multiplying (*) the tip and the subtotal after adding the tax to the meal cost. Sample Run Enter the cost of the meal: 120.00 Bill Information: Meal Cost: $120.00 Tax: $9.42 Tip: $12.942 Total: $142.362
Please check my two C++ codes for the following problems. Please correct and mistakes and tell me why you fixed them so that I know what to do right the next time thank you. #include ;
using namespace std;
int main()
{
char Firstname,
Lastname;
int Age,
Weight;
cout
cin >> Firstname
cout
cin >> Lastname
Cout
cin >> Age
cout
cin >> Weight
cout
cout
cout
return 0;
}
# include ;
using namespace std;
int Mealcost, Taxamount,
tipamount,totalbill;
const double tax = 7.85;
const double tip = .10;
double totalbill
int main ()
{
cout
cin >> Mealcost;
Taxamount = Mealcost*tax;
tipamount = Mealcost+Taxamount*tip;
totalbill = Mealcost+Taxamount+tipamount;
cout
cout
cout
cout
cout
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
