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
How can you evaluate whether the slope of the dependent variable with an independent variable is the same for each level of the
s2008m [1.1K]

Answer:

By running multiple regression with dummy variables

Explanation:

A dummy variable is a variable that takes on the value 1 or 0. Dummy variables are also called binary

variables. Multiple regression expresses a dependent, or response, variable as a linear

function of two or more independent variables. The slope is the change in the response variable. Therefore, we have to run a multiple regression analysis when the variables are measured in the same measurement.The number of dummy variables you will need to capture a categorical variable

will be one less than the number of categories. When there is no obvious order to the categories or when there are three or more categories and differences between them are not all assumed to be equal, such variables need to be coded as dummy variables for inclusion into a regression model.

3 0
3 years ago
Birdie Par owns a company that makes golf gloves. She is thinking about introducing a new glove, which would require an addition
melamori03 [73]

Birdie's company will make a profit of $30,000 if she sells 3,000 gloves at the $15 price.

Step-by-step Solution:

Break even point= fixed cost/ selling price - variable cost

here the fixed cost is= $20,000

selling price= $15 and variable cost = $5

BEP= 20,000/ 15-5= 20,000/10= 2000 units

b. if they sell 3000 gloves, the contribution profit will be

total revenue= 3000*$15= $45,000

contribution= selling price- variable cost, 15-5= $10 per unit

the profit is= 3000*$10= $30,000

What is  variable cost?

A variable cost is one that varies in relation to either the volume of production or the number of services provided. There should be no variable costs if no production or services are provided. Variable costs should rise in tandem with increases in production or services.

To learn more about Profit Calculation, visit: brainly.com/question/28177180

#SPJ1

3 0
1 year ago
A Pelton wheel is supplied with water from a lake at an elevation H above the turbine. The penstock that supplies the water to t
gayaneshka [121]

Answer:

Following are the proving to this question:

Explanation:

\frac{D_1}{D} = \frac{1}{(2f(\frac{l}{D}))^{\frac{1}{4}}}

using the energy equation for entry and exit value :

\to \frac{p_o}{y} +\frac{V^{2}_{o}}{2g}+Z_0  = \frac{p_1}{y} +\frac{V^{2}_{1}}{2g}+Z_1+ f \frac{l}{D}\frac{V^{2}}{2g}

where

\to p_0=p_1=0\\\\\to Z_0=Z_1=H\\\\\to v_0=0\\\\AV =A_1V_1 \\\\\to V=(\frac{D_1}{D})^2 V_1\\\\\to V^2=(\frac{D_1}{D})^4 V^{2}_{1}

         = (\frac{1}{(2f (\frac{l}{D} ))^{\frac{1}{4}}})^4\  V^{2}_{1}\\\\

         = \frac{1}{(2f (\frac{l}{D})  )} \  V^{2}_{1}\\

\to \frac{p_o}{y} +\frac{V^{2}_{o}}{2g}+Z_0  =\frac{p_1}{y} +\frac{V^{2}_{1}}{2g}+Z_1+ f \frac{l}{D}\frac{V^{2}}{2g} \\\\

\to 0+0+Z_0 = 0  +\frac{V^{2}_{1} }{2g} +Z_1+ f \frac{l}{D} \frac{\frac{1}{(2f(\frac{l}{D}))}\ V^{2}_{1}}{2g}   \\\\\to Z_0 -Z_1 = +\frac{V^{2}_{1}}{2g} \ (1+f\frac{l}{D}\frac{1}{(2f(\frac{l}{D}) )} )  \\\\\to H= \frac{V^{2}_{1}}{2g} (\frac{3}{2}) \\\\\to  \frac{V^{2}_{1}}{2g} = H(\frac{3}{2})

L.H.S = R.H.S

7 0
3 years ago
Consider a space shuttle weighing 100 kN. It is travelling at 310 m/s for 30 minutes. At the same time, it descends 2200 m. Cons
mixas84 [53]

Answer:

work done = 48.88 × 10^{9} J

Explanation:

given data

mass = 100 kN

velocity =  310 m/s

time = 30 min = 1800 s

drag force = 12 kN

descends = 2200 m

to find out

work done by the shuttle engine

solution

we know that work done here is

work done = accelerating work - drag work - descending work

put here all value

work done = ( mass ×velocity ×time  - force ×velocity ×time  - mass ×descends )  10³ J

work done = ( 100 × 310 × 1800  - 12×310 ×1800  - 100 × 2200 )  10³ J

work done = 48.88 × 10^{9} J

6 0
3 years ago
You don't have to notify employees that a lockout/tagout is about to begin?
Sergeu [11.5K]

Answer:

When the imposter is sus : O

Explanation:

3 0
3 years ago
Other questions:
  • The elementary liquid-phase series reaction
    11·1 answer
  • Here u go vagdhf dis day did. Du video ioi Hi I gotta go to do something fun to do something that would you want to me see you l
    15·1 answer
  • The yield strength of mild steel is 150 MPa for an average grain diameter of 0.038 mm ; yield strength is 250 MPa for average gr
    15·1 answer
  • A sludge pump pumps at a rate of 40 GPM. The raw sludge density is 4.5 percent solids. How many minutes per hour should the pump
    11·1 answer
  • The acceleration of a point is given. a = 20 t m/s2 When t=0, s = 50 m and v = -8 m/s. What are the position and velocity of the
    13·1 answer
  • A can of engine oil with a length of 150 mm and a diameter of 100 mm is placed vertically in the trunk of a car. On a hot summer
    8·1 answer
  • What Are 2 Properties electromagnets have that permanent magnets do not?
    8·2 answers
  • Cast iron has about how much carbon content?
    12·1 answer
  • What is the relationship between compressor work and COPR?
    14·1 answer
  • A helicopter is hovering in a steady cross wind at a gross weight of 3,000 lb (1,360.8 kg). This helicopter has 275 hp (205 kW)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!