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
What is a shearing stress? Is there a force resulting from two solids in contact to which is it similar?
Luba_88 [7]

Answer:

Shearing stresses are the stresses generated in any material when a force acts in such a way that it tends to tear off the material.

Generally the above definition is valid at an armature level, in more technical terms shearing stresses are the component of the stresses that act parallel to any plane in a material that is under stress. Shearing stresses are present in a body even if normal forces act on it along the centroidal axis.

Mathematically in a plane AB the shearing stresses are given by

\tau =\frac{Fcos(\theta )}{A}

Yes the shearing force which generates the shearing stresses is similar to frictional force that acts between the 2 surfaces in contact with each other.  

7 0
4 years ago
A river has an average rate of water flow of 59.6 M3/s. This river has three tributaries, tributary A, B and C, which account fo
Fiesta28 [93]

Answer:

50421.6 m³

Explanation:

The river has an average rate of water flow of 59.6 m³/s.

Tributary B accounts for 47% of the rate of water flow. Therefore the rate of water flow through tributary B is:

Flow rate of water through tributary B = 47% of 59.6 m³/s = 0.47 * 59.6 m³/s = 28.012 m³/s

The volume of water that has been discharged through tributary B = Flow rate of water through tributary B * time taken

time = 30 minutes = 30 minutes * 60 seconds / minute = 1800 seconds

The volume of water that has been discharged through tributary B in 30 seconds = 28.012 m³/s * 1800 seconds = 50421.6 m³

3 0
3 years ago
Urgent please help me...
Pepsi [2]
Scuze , am incercat , dat chiar nu stiu. Prefer sa nu raspund si sa scriu asta decat sa raspund gresit.❤️
7 0
3 years ago
The error in the trapezoidal rule is proportional to h^2 True b. False
Lynna [10]

Answer:

b) False

Explanation:

in trapezoidal rule the error is proportional to h^3 and the order of accuracy is proportional to h^3 .

Trapezoidal rule is numerical integration method .Trapezoidal rule is used to find the area of curves.In trapezoidal rule we finds the approximate value of integration.But the real value of integration will not differ to much from the value which finds by using trapezoidal rule.

4 0
3 years ago
If gas costs $3.50 per gallon, how much would it cost to drive 500 miles in a city in a car that is 58.3 km/L
Akimi4 [234]
1 liter = .264 gallon
1 km = .621 mile

this means that 58.3km/L is equal to 137.13mpg

so

500/137.13 = 3.65 gallons of gas

3.65 x 3.5 = $12.78
5 0
3 years ago
Other questions:
  • What is the composition, in atom percent, of an alloy that contains 44.5 lbmof Ag, 83.7 lbmof Au, and 5.3 lbmof Cu? What is the
    9·1 answer
  • Answer the following questions, and very briefly explain your answer:
    5·1 answer
  • A lake with a surface area of 525 acres was monitored over a period of time. During onemonth period the inflow was 30 cfs (ie. f
    5·1 answer
  • What are significant figures​
    13·1 answer
  • Which type of finish is absorbed into the wood?
    7·1 answer
  • Which excerpt from "The Chrysanthemums' best reveals that Elisa is proud of her
    6·1 answer
  • Help me, iv been having problems with ads going in my phones storage files, what can i do to stop this?
    14·2 answers
  • Consider a machine of mass 70 kg mounted to ground through an isolation system of total stiffness 30,000 N/m, with a measured da
    9·1 answer
  • A retail business, owned by share holders and having centralized decision making for their multiple store locations is called:
    13·1 answer
  • Which option distinguishes why the behaviors of the team in the following scenario are so important during the engineering desig
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!