Question: JAVA LANGUAGE Suppose you find a magic $1.00 coin. Its magic power is as follows: as each day passes, you get an additional dollar plus

JAVA LANGUAGE

JAVA LANGUAGE Suppose you find a magic $1.00 coin. Its magic power

Suppose you find a magic $1.00 coin. Its magic power is as follows: as each day passes, you get an additional dollar plus half of what you already had (it appears by the window somehow). Write a method called getRichQuick (no input is necessary for this method) that prints the first n days while your total is less than $1,000,000 dollars. In other words, how many days does it take for you to earn $1,000,000? Your program should calculate these numbers and print the following output: Day 1: $1 Day 2: $1 + (S1 .50) $2.50 Day 3: $2.50 + (S1 1.25)-$4.75 Day N: SX + (S1 + Y)$1000000

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 Databases Questions!