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
g FisherCo is intending to invest in a new project. The ________ is the minimum rate of return the firm will accept on this proj
IrinaK [193]

FisherCo is intending to invest in a new project. The hurdle rate is the minimum rate of return the firm will accept on this project.

The hurdle rate is the minimum rate of return a project must have in order for a project to be accepted. It can also be referred to as the discount rate or the required rate of return or the cost of capital.

When the hurdle rate is greater than the internal rate of return of a project, the project would be rejected. If the hurdle rate is less than the internal rate of return of a project, the project would be accepted.

To learn more, please check: brainly.com/question/17439820

6 0
3 years ago
The building code of River City requires that elevators in public buildings be inspected every nine months. Hal did not have the
Archy [21]

Answer: Public tort

Explanation: In simple words, public tort refers to the minor breach of contract by an individual. It is considered as a civil offense but still the acts under this act carries a criminal punishment.

In the given case, Hal did not make the elevator inspected in the seventh story for two years, however all other were inspected as per the rules. Thus, we can conclude that he breached the rule on a small level.

Hence from the above we can conclude that his offense would be classified as public tort.

3 0
4 years ago
The bonds issued by Stainless Tubs bear an 8 percent coupon, payable semiannually. The bonds mature in 11 years and have a $1,00
GenaCL600 [577]

Answer:

8.69%

Explanation:

Face value (FV)=$ 1,000.00

Coupon rate=8.00%

Interest per period (PMT) =$30.00

Bond price (PV)=$ 952.00

Number of years to maturity 11

Number of compounding periods till maturity (N)                                                  22

Bond Yield to maturity RATE(NPER,PMT,PV,FV)*2 = 8.69 %

4 0
3 years ago
Consider two perfectly negatively correlated risky securities A and B. A has an expected rate of return of 10% and a standard de
Studentka2010 [4]
I’m sorry for making it happen again but it’s not like that
7 0
3 years ago
The Bob Buckham Senior Center, a not-for-profit entity, serves a hot meal to senior citizens every Friday evening. All the food
elena-14-01-66 [18.8K]

Answer:

c. Report $10,000 revenue and expense | Disclose in the notes

Explanation:

Not-for-profit entities must report the fair value of all the goods they receive as donations. in this case, they would have to report the $10,000 worth of food received from a local supermarket. But they are not required to report the value of volunteer work, they only have to disclose it on the footnotes of their financial statements.

4 0
3 years ago
Other questions:
  • For​ August, Bletchley Blinds will have cash receipts of​ $97,000 and cash disbursements of​ $108,000. If its beginning cash is​
    5·1 answer
  • You purchased 3,000 shares of the New Fund at a price of $25 per share at the beginning of the year. You paid a front-end load o
    12·1 answer
  • In an early U.S. Supreme Court interpretation of the commerce clause, the Court ruled that _______ could regulate labor relation
    12·1 answer
  • Balance sheet accounts Group of answer choices 1. are called real accounts 2. have zero balances after the closing entries have
    12·1 answer
  • Use the following selected information from Wheeler, LLC to determine the 2017 and 2016 trend percentages for net sales using 20
    11·1 answer
  • County governments in Texas:a.are single-purpose governments.b.all operate under the general laws of the state of Texas for the
    14·1 answer
  • Hunter Thompson, an owner, made an additional investment of $21,000 in cash. A firm purchased equipment for $10,000 in cash. A f
    5·1 answer
  • Broad, Inc. had a beginning inventory of $50,000 and an ending inventory of $80,000. Its Cost of Goods Sold for the year was $97
    13·1 answer
  • Suppose the government in this economy decides to decrease government purchases by $300 billion. The decrease in government purc
    9·1 answer
  • Novak Corporation purchased 380 shares of Sherman Inc. common stock for $12,900 (Novak does not have significant influence). Dur
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!