Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume you were offered a job that paid $0.01 on the first day, $0.02 the 2nd day, $0.04 the 3rd day (each days income is

  1. Assume you were offered a job that paid $0.01 on the first day, $0.02 the 2nd day, $0.04 the 3rd day (each days income is double the previous days income
  2. Display what you made on each day
  3. Calculate and show how much you made for the entire 30 days of work
  4. Remember that you should #include and add the following to display decimal numbers neatly
    cout << fixed << setprecision(2);

Description

The purpose of this challenge is to use the for loop. This challenge uses the concepts of accumulators and loops.

Requirements

  1. Assume you were offered a job that paid $0.01 on the first day, $0.02 the 2nd day, $0.04 the 3rd day (each days income is double the previous days income)
  2. Display what you made on each day
  3. Calculate and show how much you made for the entire 30 days of work
  4. Remember that you should #include and add the following to display decimal numbers neatly
    cout << fixed << setprecision(2); 

DO NOT USE

Any power or exponentiation formulas

Sample Interaction / Output

On day 1, you made $0.01 On day 2, you made $0.02 On day 3, you made $0.04 ... (show all days here) ... On day 29, you made $2684354.56 On day 30, you made $5368709.12 After 30 days, you made $10737418.23

Pay close attention to the last line above that shows the total amount earned having worked 30 days (this is the total amount earned through the 30 days).

Make sure your total shows the amount above, not a penny more, not a penny less.

If you use a method that arrives at $10737418.24 total earnings, do not simply subtract a penny to make it correct. HINT: If you arrive at a number with 24 cents, you are not showing the accumulated earnings for the 30 day period, you are displaying the amount that would be earned on the 31st day

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions