Question: Open the part 1 . cpp file. In the function, write a program that prints a simple form letter on the console based on user

Open the part1.cpp file. In the function, write a program that prints a simple form letter on the console based on user input.
Define a string variable
Prompt the user with "Enter the first name of the person you want to write to: "
Prompt the user to enter the age of the recipient and assign it to an integer variable
Prompt the user for the name of another friend and store it in a string variable friend_name .
Start your letter with "Dear ,". Don't forget the comma and the newline.
Add an introductory line or two, like "How are you? I am fine. I miss you." Be sure to indent the first line. Add a few more lines of your choosing it's your letter.
Now add a line to your letter: "Have you seen lately?"
Have your program print, "I hear you just had a birthday, and you are years old."
If your friend is under 12, write, "Next year, you will be ,+1." If your friend is 17, write, "Next year, you will be able to vote." If your friend is over 70, write, "Are you retired?". Check your program to make sure it responds appropriately to each kind of value. (skip this step if you don't remember if-conditions).
Add "Yours sincerely," followed by two blank lines for a signature, followed by your name.
Part 2:
Open the part2.cpp file. In the function, write a program that prompts the user to enter some number of pennies (1-cent coins), nickels (5-cent coins), dimes (10-cent coins), quarters (25-cent coins), half-dollar coins (50-cent coins), and onedollar coins (100-cent coins). Query the user separately for the number of each size coin, e.g., "How many pennies do you have?" Then your program should print out something like this:
You have 23 pennies.
You have 17 nickels.
You have 14 dimes.
You have 7 quarters.
You have 3 half-dollar coins.
You have 0 one-dollar coins.
The value of all of your coins is 573 cents.
Make some improvements (extra):
If only one of a coin is reported, make the output grammatically correct, e.g.,14 dimes and 1 dime (not 1 dimes).
Report the sum in dollars and cents, i.e., $5.73 instead of 573 cents.
Open the part 1 . cpp file. In the function,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!