Question
p) and submit them in Canvas. Be sure to include the header comment in each file and follow proper styling and commenting guidelines for better
p) and submit them in Canvas. Be sure to include the header comment in each file and follow proper styling and commenting guidelines for better readability.
1. Write a program that asks the user for two integers (lets call input 1 my_num and input 2 x). The program will divide my_num by x three times and outputs the quotient after each division. For example:
If the input is 2000 2
Then the output should be 1000 500 250
2. Write a program that asks the user for the number of quarters, dimes, nickels, and pennies (in that order) they have. Then calculate and output the amount of U.S. dollars the coins are worth. Use setprecision and setw to format your output to two decimal places. For example:
If the input is 4 3 2 1, which is 4 quarters, 3 dimes, 2 nickels, and 1 penny,
Then the output should be You have $1.41
3. Write a program that inputs a string from the user and outputs that same string backwards. For example:
If the input is Peter Piper Picked a Pickled Pepper.
The output should be .reppeP delkciP a dekciP repiP reteP
4. Rewrite problem 2(copy your solution from problem 2 and paste it into a separate file) and create a function called calc_amount. This function will take 4 integers for the change amount and convert that change into dollars. The dollar amount calculated will be passed back through the return statement, where the amount should be outputted in main.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started