Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Create a C++ program starting with a cout statement to ask the user to “Enter your full name: ” and then store the result in a fullName string variable. You must use getline with your cin statement so

Create a C++ program starting with a cout statement to ask the user to “Enter your full name: ” and then store the result in a fullName string variable. You must use getline with your cin statement so that the program can handle having two or more words display as fullName and send the user to a new line and then to another new line. (See screen shots below)

Next, ask the user “How many quarters do you have? “ and save the user's response to an int variable named numberOfQuarters using a cin statement and send the user to a new line. (See screen shots below)

Next, ask the user “How many dimes do you have? “ and save that number to an int variable named numberOfDimes using another cin statement and send the user to another new line. (See screen shots below)

Next, ask the user “How many nickels do you have? “ and save that number to an int variable named numberOfNickels using a cin statement and send the user to another new line. Then send the user to another new line as seen in the screen shots below.

You then need to calculate the total number of pennies. You get this calculation from the quarters, dimes, and nickels variables. You multiply the number of quarters entered times 25 and the number of dimes entered times 10 and the number of nickels entered times 5 to get the total number of pennies and then add those numbers up and assign the result to the double variable named totalNumberOfPennies.

Then, do another calculation to divide the totalNumberOfPennies by 100 and assign the result to a double variable named dollarsAndCents

Next, display the results as seen in the test cases below:

Next, use a cout statement to say “Hi “ and add the fullName variable to the cout statement and then add a comma and enter the code to go to a new line. (See screen shots below)

Use another cout statement to type "The change in pennies = “ and then use the variable you created for the total number of pennies (totalNumberOfPennies) and go to a new line. This result should be displayed as a whole number (no decimal places). (See screen shots below)

Finally, display the pennies in dollar output format with two decimal places in another cout statement stating, “The dollars and cents = $” and then put the dollarsAndCents variable next to it. (See screen shots below)

You also need to include a cout statement with fixed showpoint and setprecision as appropriate to show exactly two decimal places for the dollarsAndCents double variable. Also, put a $ sign in the appropriate place in the cout statement so that the $ sign shows up right next to the dollarsAndCents variable. (See screen shots below)

TEST DECK 1: Enter your full name. Then put 10 for quarters and enter, then put 15 for dimes and enter, then put 20 for nickels and enter again. The result should be 500 pennies and $5.00 for dollars and cents. (See screen shot below for the exact output your code should display)

see test deck 1 in attached 

TEST DECK 2: Enter your full name. Then put 1 for quarters and enter, then put 2 for dimes and enter, then put 3 for nickels and enter again. The result should be 60 pennies and $0.60 for dollars and cents. (See screen shot below for the exact output your code should display)

see test deck 2 in attached 

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question