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
Which of the following is not true about manufacturing employment in the U.S?
MakcuM [25]

Explanation:

If I guessed, I'd say the answer is choice (a).

The change in skills required to perform new tasks in manufacturing, along with import competition and a decline in mobility, have contributed to the decline of employment rate for manufacturing since 2000

4 0
2 years ago
The following displacement (cm), output (V) data have been recorded during a calibration of an LVDT. Displacement (cm), output (
nadya68 [22]

Answer:

2.08V/cm

Explanation:

Plot the points on a graph. Draw the line of best fit. Calculate the gradietn of line of best fit.

Attached is the graph plotted on excel.

The equation of the line is

Votlage= 2.08× distance + 0.276

4 0
3 years ago
Define coordination number. How does this differ from atomic packing factor?
Fynjy0 [20]

Answer:

Coordination number:

        Coordination number can be defined as the number of nearest atoms which touch the central atom.In simple word the number of neighbours atoms which touches a an atoms.

Atomic packing factor :

It is also known as packing efficiency.It is the fraction of volume in a Crystal which is filled by constituent particles.It is always less than 1.Generally it is represented in the fraction.

Ex:

Lets take FCC cubic cell

Coordination number = 12 .

Atomic packing factor = 74%

4 0
3 years ago
Suppose you are asked to design an office building. Explain what type of drawing you would use and why.
ohaa [14]

Answer:

birds-eye view perspective

Explanation:

If someone asked me to design an office building, I would draw it from a birds-eye view perspective. I would draw it this way so I could map out where everything in the office would go and make sure I have enough space for everything. I would also draw it this way in order to clearly see where everything would go in the office. For instance, cubicles/desks could go in the bottom left corner, while the boss's office could go in the top right. It would be easier to organize and it would be easier for me to look back on when I need to actually design the office later.

(i'm not sure if this is what your question is asking for so i just made my best guess)

7 0
3 years ago
Read 2 more answers
Select the best answer for the question.
zepelin [54]
The answer for this question is A
8 0
2 years ago
Read 2 more answers
Other questions:
  • To cool a summer home without using a vapor compression refrigeration cycle, air is routed through a plastic pipe (k=0.15 W/m*K,
    15·1 answer
  • Which phrases describe an irregular galaxy?
    8·1 answer
  • A four-lane freeway (two lanes in each direction) is located on rolling terrain and has 12-ft lanes, no lateral obstructions wit
    14·1 answer
  • For a copper-silver alloy of composition 25 wt% Ag-75 wt% Cu and at 775°C (1425°F) do the following:
    15·1 answer
  • What type of drawing would civil engineers use if they needed to show an
    11·1 answer
  • Calculate the potential energy in kJ of a human body (70 kg) possesses on top of the Empire State Building (1,250 ft tall).
    7·1 answer
  • Air is compressed in an isentropic process from an initial pressure and temperature of P1 = 90 kPa and T1=22°C to a final pressu
    7·1 answer
  • 1) Each of the following would be considered company-confidential except
    10·1 answer
  • Calculate the acceleration of a 2000kg single engine airlane just before take off when the thrust of the engine is 500n?
    5·1 answer
  • Silicon chips are used primarily in ?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!