answer.
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]
2 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]2 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
The electrical energy used by an air conditioner for 2 minutes is 180 kJ. Calculate the power of this air conditioner in the fol
ELEN [110]

Answer:

I hope it is correct.....

5 0
2 years ago
When should you exercise extreme caution around power lines?
Elis [28]

<em>You should take note and exercise extreme precautions when you are near power lines and consider the following: </em>

<em> </em>

<em>1. Make sure that you have a good distance away from the lines. The minimum distance you can get is 10 feet away from the lines. Be cautious as well when you see broken lines as they could still harm you and electrified you. </em>

<em>2. Do not make ladders, equipments and things around you touch the power lines as it may harm you as well. </em>

<em>3. Clear everything and ensure that no things are near you before you lift your hands and other tools.</em>

6 0
2 years ago
The extruder head in a fused- deposition modeling setup has a diameter of 1.25 mm (0.05 in) and produces layers that are 0.25mm
Angelina_Jolie [31]

Answer:

The time taken will be "1 hour 51 min". The further explanation is given below.

Explanation:

The given values are:

Number of required layers:

= \frac{38}{0.25}

= 152 \ layers

Diameter (d):

= 1.25 mm

Velocity (v):

= 40 mm/s

Now,

The area of one layer will be:

= 38\times 38 \ mm^2

= 1444 \ mm^2

The area covered every \second will be:

= d\times v

= 1.25\times 40

= 50 \ mm^2

The time required to deposit one layer will be:

= \frac{1444}{50}

= 28.88 \ sec

The time required for one layer will be:

= 15 \ sec

∴ Total times required for one layer will be:

= 15+28.88

= 43.88 \ sec

So,

Number of layers = 152

Therefore,

Total time will be:

= 152\times 43.88

= 6669.76 \ sec

= 1 \ hour \ 51 \ min

6 0
2 years ago
A 20-centimeter wrench is used to loosen a bolt. The force is applied 0.20m from the bolt. It takes 50 newtons to loosen the bol
defon

Answer:

The force would be 57.8 N if it was applied at a 30-degree angle from perpendicular.

Explanation:

We know that torque and force are represented by the following equation

τ =  r x F sinθ ---- (1)

where τ is Torque, r is radius, F is force and θ is the angle between the force and lever arm.

Given data:

F = 50 N

r = 0.2 m

we have to find the force when θ = 30°

Putting these values in equation 1, we get

τ  = 0.2 x 50 x sin(90°)

τ  = 10 Nm

so Torque is 10 Nm

Now we will calculate the force was applied at a 30 degree angle from perpendicular, in this case the equation 1 becomes as

τ =  r x F cosθ

Putting the values of τ , r, θ  and F in above equation

10 = 0.2 x F x cos(30°)

Rearranging the above equation

F = 10 / (0.2 x cos (30°))

F = 10 / 0.173

F = 57.8 N

8 0
2 years ago
The current drawn by fluorescent lighting has a high total harmonic distortion. For this case, THD is calculated to be 88%. The
Alona [7]

Answer:

displacement power factor is 0.959087

Explanation:

given data

THD = 88%

true power factor = 0.72

solution

we get here total harmonic distribution THD is express as here

THD = \sqrt{\frac{1}{g^2}-1}       ..............1

her g is distortion factor

so put here value and we will get g that is

0.88² =   \frac{1}{g^2} -1    

solve it we get

g = 0.750714

and

displacement power factor is express as

DPF = \frac{PF}{g}   .................2  

put here value and we will get

DPF = \frac{0.72}{0.750714}    

DPF  = 0.959087

3 0
2 years ago
Other questions:
  • Radioactive wastes are temporarily stored in a spherical container, the center of which is buried a distance of 10 m below the e
    13·1 answer
  • A particle has an initial velocity of v0 = 14 ft/s to the right, at s0 = 0, and a = 2 ft/s2 to the left. determine its position
    5·1 answer
  • Water is the working fluid in an ideal Rankine cycle. The condenser pressure is 8 kPa, and saturated vapor enters the turbine at
    10·1 answer
  • A three-story school has interior column bays that are spaced 25 ft apart in both directions. If the loading on the flat roof is
    7·1 answer
  • You are an electrician on the job. The electrical blueprint shows that eight 500-W lamps are to be installed on the same circuit
    11·1 answer
  • The in situ moist unit weight of a soil is 17.3 kN/m^3 and the moisture content is 16%. The specific gravity of soil solids is 2
    11·1 answer
  • Which one of the following activities is not an example of incident coordination
    15·1 answer
  • A rectification column is fed 100 kg mol/h of a mixture of 50 mol % benzene and 50 mol % toluene at 101.32 kPa abs pressure. The
    5·1 answer
  • A soil element is subjected to a minor principle stress of 50 kPa on a plane rotated 20 ° counterclockwise from vertical. If the
    10·1 answer
  • NEEDS TO BE IN PYTHON:ISBN-13 is a new standard for indentifying books. It uses 13 digits d1d2d3d4d5d6d7d8d910d11d12d13 . The la
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!