Question: ( in c + + ) Write a program that displays the following menu: 1 - Ask a user for their age and determine whether
in cWrite a program that displays the following menu:
Ask a user for their age and determine whether the user was born in an odd or an even year.
Calculate the tax based on user's weekly income assuming the tax deduction rate is
It is the pi day, and Lone Star College wants to bake pies for students. Your job is to write a program to calculate the number of slices a pie of any size can be divided into.;
Quit the program
If the user enters the program should ask the user for their name using getline and their age, then the program should display print the user's name and tell the user what year they were born in and whether if the year was an even or odd number.
Input validation: Your program should ONLY accept positive numbers for birth year.
If the user enters the program should ask the user's name, and their weekly income. Assuming the tax deduction rate, the program then should calculate the tax based the employee has to pay. Print the user's name and the tax amount limited to only two decimal points utilizing fixed and set precision.
Input validation: Your program should ONLY accept positive numbers for price and tax rate.
If the user enters The program should ask the student's first name and last name. You also need to ask the student for a random diameter of a pie in inches. Then your program should calculate the number of slices that may be taken from the pie with student's given diameter, and present the result in an integer type utilizing typecasting.
Output:
Your program should display a message telling the user Hi and then the full name on the first line utilizing getlinecin name function in string library.
Your program should print another line with the following format stars message star utilizing Setfill and setw functions in iomanip library. Example of the output line is as follow:
Welcome to Lone Star College Pie Day
Your program will now print another line that will say Your Pie will have XXXX number of slices.
Note: To calculate the number of slices that may be taken from the pie, you must know the following facts:
To get student's full name you need to include String library: #include
to use Setfill and setw to print stars, you need iomanip library: #inlclude
Each slice should have an area of inches
To calculate the number of slices, simply divide the area of the pie calculated based on user's given diameter by
Radius is Diameter
The area of the pie is calculated with this formula: Area pi r to the power of where pi is approximately and r is the radius half the the diameter
Input Validation: Your program should only accept positive numbers.
If the user enters the program should quit.
Once done, the program should ask the user if they would like to repeat the program and should the user reply Y or y the program should display the menu and ask the user to make another choice using a dowhile loop.
More Input Validation: Display an error message if the user enters a
number outside the range of through or a char or a string when selecting an item
from the menu.
I am very new to this and having a lot of difficulty if I could possibly get some help, I really think this was a bit too much for a first time project. This is what I have right now......
Menu Driven Project
#include
#include
#include
using namespace std;
int main
char choice;
string name;
int income;
double tax;
our menu options
cout "Please choose an option
;
cout Gives your birth year and rather it is odd or even
;
cout Gives you your weekly tax
;
cout Find out how many slices you can get from a pie
;
cout End program
;
cin choice;
switch choice
case : cout "Enter your name
;
cin name;
cout "Enter age
;
cin age;
year age;
cout name is born in
year;
if year
cout "The year you were born is an even number
;
else
cout "The year you were born is an odd number
;
break;
case : cout "Enter your name
;
cin name;
cout "What is your weekly income?
;
cin income;
tax income ;
cout
name:" name;
cout
tax:" tax;
break;
case : cout "What is your first and last name?
;
int pie, diameter;
cin name;
cout "Please enter a number for the diameter of the pie
;
cin diameter;
pie diameter ;
cout
name:" name;
cout
number of slices:" pie;
break;
case :
exit;
break;
defult:
cout
Please enter a choice of to ;
break;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
