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
skelet666 [1.2K]
3 years ago
15

Write a method printShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, prin

t "Too few.". If more than 4, print "Too many.". Else, print "N: Lather and rinse." numCycles times, where N is the cycle number, followed by "Done.". End with a newline. Example output with input 2: 1: Lather and rinse. 2: Lather and rinse. Done.
Engineering
1 answer:
kirill [66]3 years ago
8 0

Answer:

// The method is defined with a void return type

// It takes a parameter of integer called numCycles

// It is declared static so that it can be called from a static method

public static void printShampooInstructions(int numCycles){

// if numCycles is less than 1, it display "Too few"

   if (numCycles < 1){

       System.out.println("Too few.");

   }

// else if numCycles is less than 1, it display "Too many"

    else if (numCycles > 4){

       System.out.println("Too many.");

   }

// else it uses for loop to print the number of times to display

// Lather and rinse

  else {

       for(int i = 1; i <= numCycles; i++){

           System.out.println(i + ": Lather and rinse.");

       }

       System.out.println("Done");

       

   }

}

Explanation:

The code snippet is written in Java. The method is declared static so that it can be called from another static method. It has a return type of void. It takes an integer as parameter.

It display "Too few" if the passed integer is less than 1. Or it display "Too much" if the passed integer is more than 4. Else it uses for loop to display "Lather and rinse" based on the passed integer.

You might be interested in
Why do engineers play a variety of roles in the engineering process?
Crazy boy [7]

Answer: The engineering design process emphasizes open-ended problem solving and encourages students to learn from failure. This process nurtures students abilities to create innovative solutions to challenges in any subject! In addition to their involvement in design and development, many engineers work in testing, production, or maintenance. These engineers supervise production in factories, determine the causes of a component's failure, and test manufactured products to maintain quality.

Explanation:

6 0
2 years ago
How does sea navigation work?
ahrayia [7]

Answer:

a clock

Explanation:

you use a clock in water

3 0
3 years ago
Explain why Chloe's design needs to be redone in the following scenario, and recommend the techniques she needs to include in he
Alenkinab [10]

Answer:

She believes he's weak and won't do what needs to be done to become a king.

Explanation:

She says ('I fear thy nature') and calls him 'too full o' th' milk of human kindness' which reflects that she feels his kindness makes him weak and may prevent him from proceeding the plan. Thus, she manipulates him to keep his kindness aside and do what she wishes him to do. She rather belittles him to get her purpose solved and

7 0
3 years ago
Read 2 more answers
A 1000 kg turbine has a rotating unbalance of 0.1 kg.m. The turbine operates at a speed between 500 to 750 rpm. What is the maxi
raketka [301]

Answer:

maximum isolator stiffness k =1764 kN-m

Explanation:

mean speed of rotation =\frac{N_1 +N_2}{2}

Nm = \frac{500+750}{2} = 625 rpm

w =\frac{2\pi Nm}{60}

  =65.44 rad/sec

F_T = mw^2 e

F_T = mew^2

       = 0.1*(65.44)^2

F_T =428.36 N

Transmission ratio =\frac{300}{428.36} = 0.7

also

transmission ratio = \frac{1}{[\frac{w}{w_n}]^{2} -1}

0.7 =\frac{1}{[\frac{65.44}{w_n}]^2 -1}

SOLVING FOR Wn

Wn = 42 rad/sec

Wn = \sqrt {\frac{k}{m}

k = m*W^2_n

k = 1000*42^2 = 1764 kN-m

k =1764 kN-m

3 0
3 years ago
Calculate the areas under the stress-strain curve (toughness) for the materials shown in Fig. below, (a) plot them as a
defon

Answer:

Explanation:

Wow

5 0
3 years ago
Other questions:
  • What is compression ratio of an Otto cycle? How does it affect the thermal efficiency of the cycle?
    14·1 answer
  • Air at 27°C and a velocity of 5 m/s passes over the small region As (20 mm × 20 mm) on a large surface, which is maintained at T
    6·1 answer
  • A plane wall, 7.5 cm thick, generates heat internally at the rate of 105W/m3. One side of the wall is insulated and the other si
    14·1 answer
  • How do the remains of plants and animals become fossil fuels. Why are they considered nonrenewable resources?
    13·1 answer
  • How will the proposed study contribute to your career?*<br>(quantity Surveying​
    11·1 answer
  • A pump transfers water from a lake to a reservoir, which is located 29.2 m above the lake, at a rate of 11.5 L/s. Determine the
    12·1 answer
  • WARNING:<br><br> when people put links in the answer it is a virus DO NOT DOWNLOAD IT
    15·2 answers
  • The velocity components expressed in m/s<br>​
    6·1 answer
  • Explain the purpose of wrench plzzz
    5·2 answers
  • I love touching the atmospheres crest
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!