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]
3 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]3 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
Which of the following kinds of computing refers to an environment of servers that house and provide access to resources users a
AveGali [126]

Answer:

Cloud is the correct answer for the above question.

Explanation:

Missing Information:

    The option is missing in the question and the question suggests to choice. The option can be liberated, cloud, disperse, digital for this question in which cloud is the correct answer.

Detailed Explanation:

  • The cloud is used to store a large amount of data or information for varies users and anyone can store or modify or delete the information from anywhere.
  • This service takes money from the user and gives service to modify, edit or add the data from anywhere using the internet. When a user wants to take the service of the cloud then he needs to contact the cloud service provider, then pays money to them and then he can enjoy the service.
  • The above question wants to ask about the term which is a vast environment of databases that provide access to the users to store and mane the data and that is the cloud which is the correct answer for the above question.
7 0
3 years ago
Which of the following are techniques that companies use to influence consumers demand for their goods and services
Lesechka [4]
A. Turning luxuries into necessaties
5 0
3 years ago
Read 2 more answers
Is the process of modifying something to make it fit certain criteria.
alexandr402 [8]

Answer:

Design Process

8 0
2 years ago
Respecting yourself and others, educating yourself and connecting with others, and protecting yourself and others are all aspect
Furkat [3]

Answer:

Digital Citizenship

Explanation: Digital citizenship refers to responsible technology usage, and teaching digital citizenship is essential to helping students achieve and understand digital literacy, as well as ensuring cyberbully prevention, online safety, digital responsibility, and digital health & wellness

5 0
3 years ago
What is a quasi vpn?
Natasha2012 [34]

Answer:

i don't think there is such thing as a quasi vpn

Explanation:

6 0
3 years ago
Other questions:
  • In which area of engineering does material selection play a vital role a design optimization b forensic engineering c mechanical
    6·1 answer
  • The acronym is used to define the process that allows multiple devices to share a single routable ip address.
    6·1 answer
  • To illustrate a point in a Word document with a simple chart, what commands should you select?
    8·2 answers
  • Brute force attacks involve identifying a valid user account and then bombarding the server with an extensive:
    13·1 answer
  • Domain of (x+8)/(x(x+10))
    12·1 answer
  • Public static String doSomething(String s) { final String BLANK = " "; //BLANK contains a single space String str = ""; //empty
    6·1 answer
  • How to write a function that counts the letters in a string in C?
    13·1 answer
  • 15
    9·2 answers
  • What are the four steps for planning a table?​
    10·1 answer
  • Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!