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
Ket [755]
3 years ago
9

public static char getRandomColor(Random random) - Using the random.nextInt(6) method call generate a random integer value betwe

en 0 and 5. The character to return for a particular integer will be: 0 → 'R' 1 → 'G' 2 → 'B' 3 → 'Y' 4 → '*' 5 → '.'
Business
1 answer:
Paha777 [63]3 years ago
6 0

Answer:

public static char getRandomColor(Random random){

int number = random.nextInt(6);

if(number == 0){

return 'R';

} else if (number == 1){

return 'G';

} else if (number == 2){

return 'B';

} else if (number == 3){

return 'Y';

} else if (number == 4){

return '*';

} else {

return '.';

}

}

Explanation:

The function take random object as parameter. First, the a generated integer between 0 to 5 is assigned to number.

Next, a block of if-else statement is use to check the generated random number and knows which character to return. If the number is 0, 'R' is returns. If the number is 1, 'G' is returns. If the number is 2, 'B' is returns. If the number is 3, ' Y' is returns. If the number is 4, '*' is returns. If the number is 5, '.' is returns.

You might be interested in
Decision #2: Planning for Retirement Erich and Mallory are 22, newly married, and ready to embark on the journey of life. They b
Wittaler [7]

Answer:

The second investment will provide the highest amount of money.

Explanation:

Giving the following information:

Option A:

They had been thinking that they would wait at least 10 years and then start investing $3000 per year to prepare for retirement, 35 years later.

Option B:

They put $3000 per year away for the next 10 years - and then simply let that money sit for the next 35 years without any additional payments.

We will assume an interest rate of 10%.

For option A, we need to use the following formula:

FV= {A*[(1+i)^n-1]}/i

A= annual deposit

FV= {3000*[(1.10^35)-1]}/0.10= $813,073.11

For option B, first, we need to determine the 10 years investment:

FV= {3000*[(1.10^10)-1]}/0.10= 47,812.27

Now, we calculate the 35-year investment with the following formula:

FV= PV*(1+i)^n

FV= 47,812.27*(1.10^35)= $1,343,641.30

7 0
3 years ago
How is the federal income tax a progressive tax?
natima [27]

It is because you always have to pay it. The federal income tax is what the govt charge to take care of United States. It will never go away, you will always have to pay it. That is why it is called a progressive tax.

6 0
3 years ago
At December 31, 2020, the following information was available from Pharoah Co.'s accounting records:
Liono4ka [1.6K]

Answer:

Pharoah's inventory at December 31, 2020 was $81,120. The right answer is a.

Explanation:

In order to calculate Pharoah's inventory at December 31, 2020 we would have to calculate the following formula:

Ending inventory at cost=Ending inventory at retail*Cost to Retail ratio

Cost to Retail ratio=$772,000 ÷ $1,184,000

Cost to Retail ratio= 0.65

Ending inventory at retail=($1,184,000 – $9,200 – $1,050,000)

Ending inventory at retail=$124,800

Therefore, Ending inventory at cost=$124,800× 0.65

Ending inventory at cost=$81,120

Pharoah's inventory at December 31, 2020 was $81,120

3 0
4 years ago
Import tariffs generally ________ the output of domestic producers of the affected products and also _________ the output of dom
Lady_Fox [76]

Answer:

increase , decrease

Explanation:

Import tariffs are amount levied on the imports of goods. tariffs makes imports more expensive and discourages import.

if an import tariff is in place for a particular good, the import of that good would reduce and this would increase domestic producers to produce more of the good to meet the demand of the good. so output of domestic producers would increase.

Because output is consumed domestically, exports would reduce.

6 0
3 years ago
A company estimates that overhead costs for the next year will be $8,320,000 for indirect labor and $155,500 for factory utiliti
Serhud [2]

Answer:

The company's plantwide overhead rate is 21.19%

Explanation:

given information:

indirect labor = $8,320,000

factory utilities = $155,500

machine hours = 400,000

to calculate the overhead rate, we can use the following formula

overheadrate = \frac{Indirectcost}{allocationmeasure}

in this case.

the indirect cost = indirect labor + factory utilities

                           = $8,320,000  + $155,500

                           = $8,475,500

allocation measure = 400,000

thus,

overheadrate = \frac{8,475,500}{400,000}

                     = 21.19%

7 0
4 years ago
Other questions:
  • Trendown inc. has launched a plan to completely transition from a clothing retailer to a cosmetic brand by the end of the year.
    9·1 answer
  • Once you have made a lifestyle choice, you cannot change your mind.<br><br> A) true<br> B) false
    11·2 answers
  • Long-term creditors are usually most interested in evaluating
    15·2 answers
  • One bag of flour is sold for $1.50 to a bakery, which uses the flour to bake bread that is sold for $4.00 to consumers. a second
    5·1 answer
  • . In the trade scenario in problem 1, due to overfishing, Norway becomes unable to catch the quantity of fish that it could in p
    13·1 answer
  • When planning her company's annual sales meeting, Cynthia sets up a chat room months in advance and encourages people from each
    6·1 answer
  • Quantum is planning on merging with Reliant Energy. Quantum currently has 80,000 shares of stock outstanding at a market price o
    7·1 answer
  • Pls help for questions no 2, 3, 4, 7, 8, 9, 10
    5·1 answer
  • Suppose the price of Twinkies decreases from $1.45 to $1.25 and, as a result, the quantity of Twinkies demanded increases from 2
    5·2 answers
  • On January 1, 2021, Oliver Foods issued stock options for 47,000 shares to a division manager. The options have an estimated fai
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!