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
2. There are three drawings that architects and designers use to indicate spaces. What are these drawing?
Zarrin [17]

Answer:

Architectural plans.

Explanation:

An architectural plan is called the drawings made by architects, civil engineers or designers of spaces or interiors, in which these professionals capture their building projects, organizing the distribution of the spaces to be used, the elements to be located in them and, fundamentally, to give construction planning a projection into reality. Thus, the plans help professionals to have a better understanding of the expected end result of the projects they are carrying out.

3 0
3 years ago
Name two common fuel gases that can be used for oxyfuel cutting
zlopas [31]
Hi

Acetylene and propane

I hope this help you!
8 0
1 year ago
How does Hydro Technology and Hydro Energy Help with Global Water Issues?
GrogVix [38]
It would have environmental and societal impacts
5 0
3 years ago
If the car passes point A with a speed of 20 m&gt;s and begins to increase its speed at a constant rate of at = 0.5 m&gt;s 2 , d
sattari [20]

Answer:

a = 1.68m/S^{2}

Explanation:

Please kindly find the attached file for explanations

3 0
3 years ago
Explain how feedback control is used to<br> adjust robotic movements.
LuckyWell [14K]

Answer:

Feedback control of arm movements using Neuro-Muscular Electrical Stimulation (NMES) combined with a lockable, passive exoskeleton for gravity compensation

6 0
2 years ago
Other questions:
  • A rotating cup viscometer has an inner cylinder diameter of 2.00 in., and the gap between cups is 0.2 in. The inner cylinder len
    9·1 answer
  • Given the following materials and their corresponding thermal conductivity values, list them in order from most conductive to le
    12·1 answer
  • Under which of the following conditions is a Type B-1 Fire extinguisher required onboard a motorized vessel?
    14·2 answers
  • An automobile having a mass of 1100 kg initially moves along a level highway at 110 km/h relative to the highway. It then climbs
    7·1 answer
  • • Differentiate between laboratory and industrial reactors​
    11·1 answer
  • A jet aircraft is in level flight at an altitude of 30,000 ft with an airspeed of 500 ft/s. The aircraft has a gross weight of 1
    11·1 answer
  • list out main types of material used in design and Manufacture of product give one example for each in engineering application ?
    10·1 answer
  • The hypotenuse of a 45° right triangle is
    5·1 answer
  • The only way to know if a design will work in real-world conditions is to build a model, or prototype, based on the plan. This i
    7·2 answers
  • Which of the following maintenance items helps to ensure the vehicles engine lasts as long as possible?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!