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 do we infer that there is
Katena32 [7]

Answer:

Not too far removed from Collingwood’s concern with the elimination of physical and moral force via social civilization are accounts of civilized society concerned with the management of violence, if only by removing it from the public sphere. Such a concern is extended in Zygmunt Bauman’s account of civilization to the more general issue of producing readily governable subjects. The “concept of civilization,” he argues, “entered learned discourse in the West as the name of a conscious proselytising crusade waged by men of knowledge and aimed at extirpating the vestiges of wild cultures” (1987, 93).

This proselytizing crusade in the name of civilization is worth considering further. Its rationale is not too difficult to determine when one considers Starobinski’s (1993, 31) assertion: “Taken as a value, civilization constitutes a political and moral norm. It is the criterion against which barbarity, or non-civilization, is judged and condemned.” A similar sort of argument is made by Pagden (1988, 33), who states that civilization “describes a state, social, political, cultural, aesthetic—even moral and physical—which is held to be the optimum condition for all mankind, and this involves the implicit claim that only the civilized can know what it is to be civilized.” It is out of this implicit claim and the judgments passed in its name that the notion of the “burden of civilization” was born. And this, many have argued, is one of the less desirable aspects and outcomes of the idea of civilization

6 0
3 years ago
What are the coventional representative of automation
Oxana [17]

Answer:

ere el merjor 5iyer

Explanation:

yyhh espero ayuder 8 mucho 666

5 0
3 years ago
If the contact surface between the 20-kg block and the ground is smooth, determine the power of force F when t = 4 s. Initially,
grigory [225]

Answer:

The power of force F is 115.2 W

Explanation:

Use following formula

Power  = F x V

F_{H} = F cos0

F_{H} = (30) x 4/5

F_{H} = 24N

Now Calculate V using following formula

V = V_{0} + at

V_{0} = 0

a = F_{H} / m

a = 24N / 20 kg

a = 1.2m / S^{2}

no place value in the formula of V

V = 0 + (1.2)(4)

V = 4.8 m/s

So,

Power = F_{H} x V

Power = 24 x 4.8

Power = 115.2 W

3 0
3 years ago
Unwanted resistance is being discussed.
krok68 [10]
I don’t know if I’m right but I’m guessing B
6 0
4 years ago
Define the following terms: data, database, DBMS, database system, database catalog, program-data independence, user view, DBA,
nalin [4]

Answer:

data - Any form of value in a column of a table in a relational database.

DBMS - Short for Database management system, which is a software that can be used to create, manipulate and view databases, e.g. MS SQL Server.

database system - Same as DBMS.

database catalog - Place where the metadata of a Database including its tables, users etc. exists, e.g. date created, size, number of columns etc. Also known as Data Dictionary.

program-data independence - Program-data independence refers to the design of keeping different levels of database (external, logical and physical) separate and loosely coupled from each other, for easier maintenance or modification work.

DBA - Short for Database Administrator, person responsible for maintaining the database. Its main responsibility is to keep the data clean and safe i.e. data doesn't contain wrong or invalid data, and is safe from viruses and is backed up.

end user - Anyone who is not directly interacting with a database, but through some software, like website or mobile application.

persistent object - An object of a class in a program, that interacts with the underlying database and is responsible for manipulating the database, the program is connected to.

transaction-processing system - A transaction process system is part of a software, responsible for making sure critical business transactions, like crediting or debiting money, either goes through cleanly or doesn't at all.

6 0
4 years ago
Other questions:
  • Calculate the thermal efficiency (ηth) for the actual cycle using pump efficiency (ηpump) = 0.85. You’ll need to find the high-p
    13·2 answers
  • What is the rms current flowing through a light bulb that uses an average power of 60.0 60.0 W when it is plugged into a wall re
    12·1 answer
  • 10 points!!<br><br> What is one thing you think a really good engineer should know/develop?...
    9·2 answers
  • A piston–cylinder assembly contains 5 kg of air, initially at 2.0 bar, 30 C. The air undergoes a process to a state where the pr
    6·1 answer
  • A small submarine has a triangular stabilizing fin on its stern. The fin is 1 ft tall and 2 ft long. The water temperature where
    9·1 answer
  • Large quantities of liquefied natural gas (LNG) are shipped by ocean tanker. At the unloading port, provision is made for vapori
    6·1 answer
  • True or False: The differential lock in an AWD-equipped vehicle can be used at any time.
    10·2 answers
  • Which is an alloy made up of iron and carbon and has high compressive and tensile strength?
    6·1 answer
  • Why water parameters of Buriganga river vary between wet and dry seasons?<br> Explain.
    7·1 answer
  • Consider a single crystal of some hypothetical metal that has the FCC crystal structure and is oriented such that a tensile stre
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!