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
There are 20 forging presses in the forge shop of a small company. The shop produces batches of forgings requiring a setup time
Aleksandr-060686 [28]

Answer:

Considering the guidelines of this exercise.

The pieces produced per month are 504 000

The productivity ratio is 75%

Explanation:

To understand this answer we need to analyze the problem. First of all, we can only produce 2 batches of production by the press because we require 3 hours to set it up. So if we rest those 6 hours from the 8 of the shift we get 6, leaving 2 for an incomplete bath. So multiplying 2 batches per day of production by press we obtain 40 batches per day. So, considering we work in this factory for 21 days per month well that makes 40 x 21  making 840 then we multiply the batches for the pieces 840 x 600 obtaining 504000 pieces produced per month. To obtain the productivity ratio we need to divide the standard labor hours meaning 6 by the amount of time worked meaning 8. Obtaining 75% efficiency.

4 0
3 years ago
True or false? Engineering degree programs and engineering technology degree programs have a different requirements
sergey [27]
That’s true brother
4 0
3 years ago
There have been many attempts to manufacture and market plastic bicycles. All have been too flexible and soft. Which design-limi
Sladkaya [172]

Answer:

The design-limiting property that insufficiently large is the elastic modulus (Young modulus)

Explanation:

Plastic usually have a relatively low elastic modulus, this couses the material to deform too much under stress. In the case of a bicycle, a little weight you put on it or little bumps will cause the bicycle to deform too much.

5 0
3 years ago
Design a half-wave recti er which provides a peak voltage of 15 V, and anaverage voltage of 3.8 V when driven by a 120 V (rms) a
nirvana33 [79]

Answer:

You need a 120V to 24V commercial transformer  (transformer 1:5), a 100 ohms resistance, a 1.5 K ohms resistance and a diode with a minimum forward current of 20 mA (could be 1N4148)

Step by step design:

  1. Because you have a 120V AC voltage supply you need an efficient way to reduce that voltage as much as possible before passing to the rectifier, for that I recommend a standard 120V to 24V transformer.  120 Vrms = 85 V and 24 Vrms = 17V = Vin
  2. Because 17V is not 15V you still need a voltage divider to step down that voltage, for that we use R1 = 100Ω and R2 = 1.3KΩ. You need to remember that more than 1 V is going to be in the diode, so for our calculation we need to consider it. Vf = (V*R2)/(R1+R2), V = Vin - 1 = 17-1 = 16V and Vf = 15, Choosing a fix resistance R1 = 100Ω and solving the equation we find R2 = 1.5KΩ
  3. Finally to select the diode you need to calculate two times the maximum current and that would be the forward current (If) of your diode. Imax = Vf/R2 = 10mA and If = 2*Imax = 20mA

Our circuit meet the average voltage (Va) specification:

Va = (15)/(pi) = 4.77V considering the diode voltage or 3.77V without considering it

6 0
3 years ago
Consider a simply supported rectangular beam with a span length of 10 ft, a width of 8 in, and an effective depth of 20 in. Norm
yulyashka [42]

Answer:

beam with a span length of 10 ft, a width of 8 in, and an effective depth of 20 in. Normal weight concrete is used for the beam. This beam carries a total factored load of 9.4 kips. The beam is reinforced with tensile steel, which continues uninterrupted into the support. The concrete has a strength of 4000 psi, and the yield strength of the steel is 60,000 psi. Using No. 3 bars and 60,000 psi steel for stirrups, do the followings:

8 0
2 years ago
Other questions:
  • why HF (hydrogen fluoride) has higher boiling temperature than HCl (hydrogen chloride), even thought HF has lower molecular weig
    8·1 answer
  • 3) What kind of bridges direct their load along it's curve and into the
    12·1 answer
  • If a pendulum takes 2 sec to swing in each direction, find the period and the frequency of the swing
    15·1 answer
  • Python lists are commonly used to store data types. Lists are a collection of information typically called a container. Think of
    5·1 answer
  • Worth 20 points! Please help ASAP!
    5·1 answer
  • Yall pls help me out
    7·1 answer
  • Which state did NOT have people that got sick from the
    10·1 answer
  • True or false for the 4 questions?
    8·1 answer
  • Which of the following is a Dashboard Scoreboard for alignment of the business where information is constantly flowing through t
    5·1 answer
  • What is software certification? Discuss its importance in the changing scenario of software industry. ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!