Question: Write a program that asks the user to input 1 ) the month and year ( input into one string variable ) , and 2
Write a program that asks the user to input the month and year input into one string variable and the number of people who have registered to attend.
Calculations:
For each item calculate the number of packages needed. For example, if there are people who registered, then three bags need to be ordered but if only register you will only need to order two packages.
Since if statements have not been introduced yet and you are not to use constructs not yet taught in the class you should instead make integer division your friend. In the case of the pens, they come in packages of
Case of people registered: in integer division is truncated to that is
Case of people registered: in integer division is truncated to that is
I leave the formula for bags and notebooks for you to figure out. This kind of thinking is very helpful in finding creative solutions to problems you will encounter in computer sciencedata science.
Calculate the total for each item. Each of the unit cost prices must be declared in main as memory constants.
Calculate the subtotal of all three items.
Calculate tax. The tax rate is to be set with a global preprocessor directive as
Calculate the total cost of the order, subtotal plus the tax.
Note: Use this sample output below to check your output
Output:
Month and year. Then for each item output description, number of packages to be ordered, and total cost for that item. Then output the subtotal for the order, amount for tax, and the total for the entire order including tax.Month and year. Then for each item output description, number of packages to be ordered, and total cost for that item. Then output the subtotal for the order, amount for tax, and the total for the entire order including tax.
Enter Month and Year: April
Enter Number of RSVPs received:
Decimal points must be lined up beautifully. This means you need to use iomanip, setprecision fixed, setw at minimum. If you pad the literal strings with spaces you will not need left and right
Absolutely no global variables. Declare variables in function main
Use no constructs loops arrays, structures, classes, etc that have not yet been taught in the course
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
