1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sdas [7]
4 years ago
6

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 o

f 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 + ($1 + .50) = $2.50
Day 3: $2.50 + ($1 + 1.25) = $4.75
...
Day N: $X + ($1 + Y) ≥ $1000000
Computers and Technology
1 answer:
AfilCa [17]4 years ago
7 0

Answer:

See explaination

Explanation:

public class QuickRich {

static void getRichQuick() {

double amount = 1;

int day = 1;

System.out.println("Day 1: $1");

while (amount < 1000000) {

day++;

if(amount + 1 + (amount/2) < 1000000)

System.out.printf("Day %d: $%.2f + ($1 + %.2f) = $%.2f\n", day, amount, amount/2, amount+(amount/2)+1);

else

System.out.printf("Day %d: $%.2f + ($1 + %.2f) >= $1000000\n", day, amount, amount/2);

amount += (1 + (amount/2));

}

}

public static void main(String[] args) {

getRichQuick();

}

}

You might be interested in
15. The game which lead many critics to rethink their ideas about video games and view games as art was ______.
Igoryamba
I think the answer is D
7 0
3 years ago
An organization is trying to decide which type of access control is most appropriate for the network. The current access control
alisha [4.7K]

Answer: D.) Discretionary access control

Explanation: Access control modes provides networks with a security system used for moderating, risk prevention and privacy maintainance of data and computing systems. Several access control modes exists depending on the degree of control required. In the discretionary access control approach, users are afforded the freedom and flexibility of making choices regarding permissions granted to programs. Hence, in this mode, permission are user-defined and as such sets privileges based on how the user deems fit.

8 0
4 years ago
Which of the following events happened first?
horrorfan [7]

Answer:

D. ARPANET was developed

Explanation:

ARPANET is an acronym for Advanced Research Projects Agency Network and it was established in 1969 by the Advanced Research Projects Agency (ARPA) of the United States Department of Defense.

ARPANET was the first wide area packet switching network for transmitting electronic data and communications between computers on a single network with a distribution functionality. The TCP/IP protocol was first implemented on the Advanced Research Projects Agency Network (ARPANET), as well as some other standard protocols such as the NCP and the 1822 protocol.

The development of ARPANET happened first in the evolution of the internet.

E-mail is an acronym for electronic mail and it was invented by Ray Tomlinson in 1971; World Wide Web was created by Tim Berners-Lee in 1990; Web 2.0 evolved in 1999.

6 0
3 years ago
FIGURE A-2—Use the information in this chart to answer Question 2.
Alex777 [14]
The answer is a because that is what is supported
3 0
3 years ago
How to make an object rotate in powerpoint animation.
insens350 [35]

Answer:

You click on the object and then click transition and there will be an option for you to rotate.

8 0
3 years ago
Other questions:
  • Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have alre
    8·2 answers
  • The Warn-on-Forecast has been developed by the National Weather Service to help predict hazardous weather earlier. Which of the
    10·2 answers
  • Which component manages the flow of data between parts of a computer
    14·1 answer
  • Gmod how to make someone admin on a lan server
    6·2 answers
  • What is a type of machine-to-human communication?
    14·1 answer
  • When is the kids choiceee awads?????????????????????????
    12·2 answers
  • Katla is a project manager. One of the programmers on her team comes to her and says that he permanently deleted some code mista
    5·1 answer
  • When performing the ipconfig command, what does the following output line depict if found in the tunnel adapter settings?
    5·1 answer
  • Which is the smallest form of data <br>a)bit <br>b)byte<br>c)nibble<br>d)8 binary digits<br>​
    10·1 answer
  • A group of small local businesses have joined together to share access to a cloud-based payment system. Which type of cloud is m
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!