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]
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
A labor-intensive process to manufacture a product has a fixed cost of $338,000 and a variable cost of $143 per unit. An automat
ozzi

Answer:

no of unit is 17941

Explanation:

given data

fixed cost = $338,000

variable cost = $143 per unit

fixed cost = $1,244,000  

variable cost = $92.50 per unit

solution

we consider here no of unit is = n

so here total cost of labor will be sum of fix and variable cost i.e

total cost of labor = $33800 + $143 n  ..........1

and

total cost of capital intensive  = $1,244,000 + $92.5 n   ..........2

so here in both we prefer cost of capital if cost of capital intensive less than cost of labor

$1,244,000 + $92.5 n  <  $33800 + $143 n

solve we get

n > \frac{906000}{50.5}

n > 17941

and

cost of producing less than selling cost so here

$1,244,000 + $92.5 n < 197 n

solve it we get

n > \frac{1244000}{104.5}  

n > 11904

so in both we get greatest no is 17941

so no of unit is 17941

3 0
2 years ago
Expalin the application of diesel cycle in detail.
mars1129 [50]

Explanation:

Diesel cycle:

        All diesel engine work on diesel cycle .In diesel cycle there are four process .These processes are as follows

1. Adiabatic reversible compression

2.Heat addition at constant pressure

3.Adiabatic reversible expansion

4.Constant volume heat rejection

In general compression ratio in diesel engine is high as compare to petrol engine.But the efficiency of diesel cycle is less as compare to petrol cycle for same compression ratio.

Applications of diesel cycle:

Generally diesel cycle used for heavy vehicle or equipment because heavy vehicle or equipment is required high initial torque.So this cycle have lots of applications such as in industrial machining,in trucks,power plant,in mining ,in defense or military,large motors ,compressor and pump etc.

   

5 0
3 years ago
Calculate the reluctance of a 4-meter long toroidal coil made of low-carbon steel with an inner radius of 1.75 cm and an outer r
My name is Ann [436]

Answer:

R = 31.9 x 10^(6) At/Wb

So option A is correct

Explanation:

Reluctance is obtained by dividing the length of the magnetic path L by the permeability times the cross-sectional area A

Thus; R = L/μA,

Now from the question,

L = 4m

r_1 = 1.75cm = 0.0175m

r_2 = 2.2cm = 0.022m

So Area will be A_2 - A_1

Thus = π(r_2)² - π(r_1)²

A = π(0.0225)² - π(0.0175)²

A = π[0.0002]

A = 6.28 x 10^(-4) m²

We are given that;

L = 4m

μ_steel = 2 x 10^(-4) Wb/At - m

Thus, reluctance is calculated as;

R = 4/(2 x 10^(-4) x 6.28x 10^(-4))

R = 0.319 x 10^(8) At/Wb

R = 31.9 x 10^(6) At/Wb

8 0
3 years ago
Water vapor at 100 psi, 500 F and a velocity of 100 ft./sec enters a nozzle operating at steady sate and expands adiabatically t
almond37 [142]

Answer:

a)exit velocity of the steam, V2 = 2016.8 ft/s

b) the amount of entropy produced is 0.006 Btu/Ibm.R

Explanation:

Given:

P1 = 100 psi

V1 = 100 ft./sec

T1 = 500f

P2 = 40 psi

n = 95% = 0.95

a) for nozzle:

Let's apply steady gas equation.

h_1 + \frac{(v_1) ^2}{2} = h_2 + \frac{(v_2)^2}{2}

h1 and h2 = inlet and exit enthalpy respectively.

At T1 = 500f and P1 = 100 psi,

h1 = 1278.8 Btu/Ibm

s1 = 1.708 Btu/Ibm.R

At P2 = 40psi and s1 = 1.708 Btu/Ibm.R

1193.5 Btu/Ibm

Let's find the actual h2 using the formula :

n = \frac{h_1 - h_2*}{h_1 - h_2}

n = \frac{1278.8 - h_2*}{1278.8 - 1193.5}

solving for h2, we have

h_2 = 1197.77 Btu/Ibm

Take Btu/Ibm = 25037 ft²/s²

Using the first equation, exit velocity of the steam =

(1278.8 * 25037) + \frac{(100)^2}{2}= (1197.77*25037)+ \frac{(V_2)^2}{2}

Solving for V2, we have

V2 = 2016.8 ft/s

b) The amount of entropy produced in BTU/ lbm R will be calculated using :

Δs = s2 - s1

Where s1 = 1.708 Btu/Ibm.R

At h2 = 1197.77 Btu/Ibm and P2 =40 psi,

S2 = 1.714 Btu/Ibm.R

Therefore, amount of entropy produced will be:

Δs = 1.714Btu/Ibm.R - 1.708Btu/Ibm.R

= 0.006 Btu/Ibm.R

3 0
3 years ago
The product life cycle defines the stages that new products move through as they enter, are established in, and ultimately leave
Bas_tet [7]

Answer:

The four marketing mix of every new business are:

1. Product

2. Place

3. Price

4. Promotion

For each of the stages of product life cycle, those 4p should be use appropriately.

Explanation:

The four marketing mix of every new business are:

1. Product

2. Place

3. Price

4. Promotion

the product life cycle are directly proportional to the 4p of marketing. the product life cycle stages are introduction, growth, maturity and decline.

For each of the stages of product life cycle, those 4p should be use appropriately.

Stages of product life cycle and how the 4p fit into it.

The introduction stage:

at this stage, a new product just want to be introduced to the consumers. the product stage has being developed. The place where the product will fit in will also be consider. the location of people who consume this product. Pricing strategy consider a low price at the introduction stage, the business owner may not get any profit at this stage. then, continuous advertisement to create awareness of the product to the environment.

The growth stage:

the product will continuing to be move to different locations. the standard of the product quality will be maintained. the Pricing will start increasing. then, continuous advertisement to create awareness of the product and working on improving the product to suit the consumer.

the Mature stage:

At this stage, the consumer are fully aware of the product. wide range of location are reach. the pricing has reach its peak. Profit have been maximized. And, competitors of the product are in the market. Corporate social responsibility (CSR) will be the promotional value at this stage.

The Declining stage:

The business product have fully grown to its peak, and its only constant promotional values like CSR, advertisement, bonuses, can sustain it in the market. At this stage also, price comparison with other competitor should be carefully look into.

4 0
3 years ago
Other questions:
  • Data becomes information when it is__________ in some way and made___________
    5·1 answer
  • Does the army good 4 you
    15·1 answer
  • 1000 lb boulder B is resting on a 500 lb platform A when truck C accidentally accelerates to the right (truck in reverse). Which
    15·1 answer
  • A large prime number isP = 232582657 - 1
    8·1 answer
  • Select the correct answer.<br> Which equation gives you the amount of work performed?
    14·1 answer
  • If the outside diameter of a pipe is 2 m, the length of a piece of insulation wrapped around it would be a)- 628 cm b)- 12.56 m.
    15·1 answer
  • If the bolt head and the supporting bracket are made of the same material having a failure shear stress of 'Tra;i = 120 MPa, det
    9·1 answer
  • You are a technical writer for Landson Toy Company. Landson has just designed a new, more durable swing set for 6- to 10-year-ol
    9·1 answer
  • ANSWER ASAP<br> What is the point system?<br> this is for driving
    8·1 answer
  • Coving is a curved edge between a floor and a wall.<br> O True<br> O False
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!