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
Explain the prosses of welding
klio [65]

Answer:

Welding is a fabrication process whereby two or more parts are fused together by means of heat, pressure or both forming a join as the parts cool. Welding is usually used on metals and thermoplastics but can also be used on wood.

Explanation:

7 0
3 years ago
Read 2 more answers
Basic concepts surrounding electrical circuitry?​
Elanso [62]
Hopefully that helps you out and is this for history or science?

3 0
3 years ago
HELP PLEASE!!!!!!!!!!!
MAXImum [283]
C is your answers!!!!!$3&2)//
7 0
3 years ago
Read 2 more answers
You are driving on a roadway with multiple lanes of travel in the same direction, and are approaching an emergency vehicle parke
solmaris [256]

Answer: a. Leave the lane closest to the emergency as soon as it is safe to do so, or slow down to a speed of 20 MPH below the posted speed limit.

Explanation:

Giving a way to the law enforcement vehicle and a medical emergency vehicle is necessary. If one approaches an emergency vehicle parked along the roadway one should change the lane as the vehicle may not move and the driver may also waste his or her time also one should also slow down his or her speed while approaching the vehicle as most of the emergency vehicle are in rush to reach the hospital so the driver should maintain some distance with the medical emergency vehicle.

7 0
3 years ago
Introduction about steam distillation
Vikentia [17]

Answer: Introduction to Steam Distillation. Steam distillation is a separation process which purifies isolate temperature-sensitive materials, such as natural aromatic compounds. In steam distillation, dry steam is passed through the plant material. These vapours undergo condensation and collection in receivers.

Explanation:

3 0
3 years ago
Other questions:
  • Does the location of a millimeter change the voltage or current of the circuit?
    7·1 answer
  • Establishes general guidelines concerning licensing and vehicle
    10·2 answers
  • Refrigerant 134a enters a horizontal pipe operating at steady state at 40oC, 300 kPaand a velocity of 40 m/s. At the exit, the t
    13·1 answer
  • What's the best way to find the load capacity of a crane? Select the best option. Call the manufacturer Ask co-workers Look at t
    8·1 answer
  • A subsurface exploration report shows that the average water content of a fine-grained soil in a proposed borrow area is 22% and
    9·1 answer
  • In the circuit given below, R1 = 17 kΩ, R2 = 74 kΩ, and R3 = 5 MΩ. Calculate the gain 1formula58.mml when the switch is in posit
    7·1 answer
  • What engine does chrysler 300c have?​
    15·1 answer
  • An atom that gained an electron is called​
    10·2 answers
  • Drivers must be careful when driving close to cyclists and should keep at least ___ feet apart when passing cyclists on the road
    15·1 answer
  • Where would the impossible amount of product 1 and 2 points intersect on the production possibility curve
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!