Question: 4.14 Ch 4 Program: Arabian Legend Students: This content is controlled by your instructor, and is not zyBooks content. Direct questions or concerns about this
4.14 Ch 4 Program: Arabian Legend
Students:
This content is controlled by your instructor, and is not zyBooks content. Direct questions or concerns about this content to your instructor. If you have any technical issues with the zyLab submission system, use the "Trouble with lab?" button at the bottom of the lab.
An old Arabian legend has it that a fabulously wealthy but unthinking king agreed to pay a beggar 1 cent and double the amount everyday for 64 days.
1) Using this information write a C++ program that uses a for loop and displays how much the king must pay the beggar on each day. The output of your program should appear as follows: (3 points)
Day Amount Owed --- ----------- 1 0.01 2 0.02 3 0.04 4 0.08 . . . . 64 ?
Attention: If you submit your program to see if you have completed this part before moving onto Part 2, then only pay attention to the first "Compare Output" section. The second, third, and fourth compare outputs are for the second part and rely on user input.
2) Modify the application to prompt the user for the amount the king paid the beggar on Day 1 and the # of Days the King agreed to pay the beggar. The output of your program should appear as follows: (3 points)
Please enter the amount the King paid on Day 1: 0.05 Please enter the number of days the King was required to pay the beggar: 5 Day Amount Owed --- ----------- 1 0.05 2 0.10 3 0.20 4 0.40 5 0.80
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
