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
lys-0071 [83]
3 years ago
14

Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, pr

int "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. Hint: Declare and use a loop variable.

Computers and Technology
2 answers:
PSYCHO15rus [73]3 years ago
6 0

// Writing a C++ function

void PrintShampooInstructions(int numCycles){

if(numCycles < 1) // if  condition stands

cout<< "To few";

else if(numCycles >4)

cour<<"Too Many";

else{

// looping the variable for desired out put

for(int i=0;i<numCycles;i++)

cout<<i<<":"<<" Lather and rinse."<<endl;

}

}

valkas [14]3 years ago
4 0

Answer:

public static void printShampooInstructions(int numOfCycles){

    if(numOfCycles < 1){

       System.out.println("Too few.");

     }

     else if(numOfCycles > 4){

        System.out.println("Too many.");

     }

     else {

        for(int index = 0; index < numOfCycles; ++index){

        System.out.println((index + 1) + ": Lather and rinse.");

     }

     System.out.println("Done.");

    }

  }

Explanation:

You might be interested in
Does virtualization impact the design of programs on behalf of the process/threading model?
zaharov [31]

Answer:

 Virtualization is the process which refers to the isolating the various computing resources that basically run without depend on the particular platform in the environment.

The virtualization basically allow the various application like software and hardware that mainly used to connect different types of server and storage applications.

The virtualization impact while designing the program is that it helps in the program execution process and also reducing the impact by using the hardware virtualization support in the system. The thread system also maintain the virtualization impact while designing.

7 0
4 years ago
If a file is opened for reading and the file does not exist,what action is taken?
worty [1.4K]

Answer:

C)An error message is issued.

Explanation:

If we try to open a file for reading when that file does not exist, we will get an error message.

For example, in Java we will encounter a FileNotFoundException as in the code below:

       try {

           FileInputStream fis = new FileInputStream("myFile.txt");

           DataInputStream dis = new DataInputStream(fis);

           BufferedReader br = new BufferedReader(new InputStreamReader(dis));

           String str = null;

           while ((str = br.readLine()) != null) {

               System.err.println(str);

           }

       } catch (FileNotFoundException e) {

           e.printStackTrace();

       }

If the file myFile.txt does not exist we can expect to see an exception stack trace corresponding to FileNotFoundException.

8 0
4 years ago
Suppose a system administrator at sls happened to read the details of this case. what steps should he or she take to improve the
kvv77 [185]
He should add more security applications to the software and inform the company to not tell any details.
6 0
4 years ago
How many errors are in the following formula?
finlep [7]

there are about two errors in the formula


4 0
3 years ago
Describe Relational Query Languages and Operations.
Lelechka [254]

Answer:

Relational query language is the language that is used in the queries of the relational databases that has rows and columns in table. The user or client presents a request for gaining the information from the database. The relationships in the database are defined in numerous ways which creates the query.

This language can be procedural form or non-procedural form.The operations performed by this language are communication with the relational database, analyzing the relationships between the entities of database,splitting the request from client and then execution of that request is done by database management system(DBMS), etc.

7 0
3 years ago
Other questions:
  • The most commonly used traffic control devices used in road construction and maintenance work areas are
    10·1 answer
  • Collaborative devices are applications that allow users to work together even when they are in different locations.
    14·2 answers
  • The syntax used for referencing cells with their worksheet names is the sheet name, followed by ____, then the usual column lett
    8·1 answer
  • Which feature of a word processing program enables you to represent an text information in the form of a diagram?
    14·2 answers
  • Surprisingly, many of us may be unknowing victims of botnets. Because of the rising sophistication of botnet schemes, your compu
    14·1 answer
  • Output devices reproduce or display which of the following
    12·2 answers
  • Secure shell (SSH) operates over which port by default
    9·1 answer
  • Which formatting option(s) can be set for Conditional Formatting rules?
    8·2 answers
  • Write a program that prints the numbers 1 - 50. If the number is even print the word 'EVEN!' next to it. If the number is odd pr
    10·1 answer
  • Which of the following does NOT describe the characteristics of cyberbullying?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!