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
nikitadnepr [17]
3 years ago
5

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 for numCycles = 2: 1: Lather and rinse. 2: Lather and rinse. Done. Hint: Declare and use a loop variable.

Computers and Technology
2 answers:
anastassius [24]3 years ago
6 0

Well, you didn't say what language, so here's in Java:


public static void PrintShampooInstructions(int numCycles)

   {

       if(numCycles < 1)

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

       else if (numCycles > 4)

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

       else

       {

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

           {

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

           }

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

       }

   }


And also in an image, in case you can't really see it

Stolb23 [73]3 years ago
6 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
JavaScript uses which property to change the current content of HTML elements?
solong [7]

Answer:

innerHTML

Explanation:

3 0
4 years ago
You enter the show ipv6 route command on an ospf device and the device displays a route. which conclusion can you draw about the
salantis [7]
<span>OSPFv3 is in use.......</span>
4 0
4 years ago
Sites on the surface web are _____.
Westkost [7]
It’s A because surface website’s are available for everybody but the dark web is opposite

3 0
3 years ago
Read 2 more answers
Once a manual is written, it may change over time as procedures change. What's a recommended format for a manual to incorporate
zhenek [66]

Answer:

Print the manual in a loose leaf binder so even small changes can be replaced

Explanation:

Procedure  manual is the document that contains the business policies and strategies. These strategies can be changed time to time in the interest of company.

As these policies or procedures changes, it is necessary to communicate with all employees. To communicate this updated information to all employees it is necessary to print all that pages, where the changes have been made to replace them in the current manual. If we print whole manual it may increase the cost of printing. To reduce printing cost and wastage of pages only print those particular pages that have been changed. This will help to communicate to the existing employees as well  as to newly hired employees.

3 0
3 years ago
Which of the following statements is true?
jeka57 [31]

Answer: Constructors can specify parameters but not return types.

Explanation:

public class Student {

 int roll_no;

 public Student(int a) {

   roll_no = a;

 }

public static void main(String[] args) {

   Student abs = new Student(10);

   System.out.println(abc.roll_no);

 }

}

In the above code we have illustrated the working of constructors. We have a class with the name Student. then a constructor is created of the class called as the class constructor. In the main we create an object of the class and with this object we invoke the constructor and also pass a parameter. Here in the code we are passing the roll no of the student.

So we can say that constructor is called during the runtime when the object created invokes the constructor so a constructor can have many arguments but it does not have a return type.

7 0
3 years ago
Other questions:
  • Within the hardware of the personal computer temporary memory is known as
    10·2 answers
  • which of the following is involved in ordering an outline. A.grouping B.merging C.organizing D.arranging
    10·1 answer
  • ?an ip address reservation is made by creating an association between an ip address and what type of client identifier?
    7·1 answer
  • To increase the view of a document on the screen, use the _____. View icon Zoom slider full-screen reading boldface font
    9·1 answer
  • How is a correction made to an Electronic health record?
    14·1 answer
  • Feedback is one of the basic elements games have in common<br><br> True<br> False
    13·2 answers
  • do you think that some people have difficulty talking to others face to face because of how prevalent texting is today
    15·2 answers
  • Partes de la ventana principal de Microsoft excel 2013 con sus respectivas funciones
    14·1 answer
  • Assignment 3: chabot<br>​
    13·1 answer
  • write a program that prompts the user to input the length of a string as an integer, followed by the string and outputs the stri
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!