answer.
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
Snezhnost [94]
2 years ago
13

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: Define and use a loop variable.
Sample program:
#include
using namespace std;

int main() {
PrintShampooInstructions(2);
return 0;
}
Computers and Technology
2 answers:
Finger [1]2 years ago
8 0

Answer:

public static void PrintShampooInstructions(int numberOfCycles){

       if (numberOfCycles<1){

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

       }

       else if(numberOfCycles>4){

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

       }

       else

           for(int i = 1; i<=numberOfCycles; i++){

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

           }

       System.out.println("Done");

   }

Explanation:

I have used Java Programming language to solve this

Use if...elseif and else statement to determine and print "Too Few" or "Too Many".

If within range use a for loop to print the number of times

Nady [450]2 years ago
4 0

Answer:

#In Python

def shampoo_instructions(num_cycles):

   if num_cycles < 1: ///

       print ('Too few.') ///

   elif num_cycles > 4:

       print ('Too many.')

   else:

       i = 0

       while i<num_cycles:

           print (i+1,": Lather and rinse.")

           i = i + 1

       print('Done.')

user_cycles = int(input())

shampoo_instructions(user_cycles)

Explanation:

def shampoo_instructions(num_cycles): #def function with loop

   if num_cycles < 1:  #using 1st if statement

       print('Too few.')

   elif num_cycles > 4:

       print ('Too many.')

   else:

       i = 0

       while i<num_cycles:

           print (i+1,": Lather and rinse.")

           i = i + 1

       print('Done.')

user_cycles = int(input())

shampoo_instructions(user_cycles)

You might be interested in
When ____ is pressed after entering an email address or web address, word automatically formats the address as a hyperlink, that
bixtya [17]
The word enter is your password
6 0
2 years ago
Read 2 more answers
The _______________ domain refers to any endpoint device used by end users, which includes but is not limited to mean any smart
viva [34]
The answer is <span>workstation.   </span>The workstation domain refers to any endpoint device used by end users, which includes but is not limited to mean any smart device in the end user's physical possession and any device accessed by the end user, such as a smartphone, laptop, workstation, or mobile device.
5 0
2 years ago
In what section of the MSDS would you find information that may help if you use this substance in a lab with a Bunsen burner?
dybincka [34]

Answer:

The answer is "Fire-fighting measures".

Explanation:

This section is used to includes instructions to combat a chemicals flame. It is also known as the identify sources, which include the instructions for effective detonating devices and details for removing devices only appropriate for just a specific situation. It is the initiatives list, that is necessary destruction technology, materials; flaming inferno dangers.

8 0
2 years ago
In which work settings would audiovisual technicians be least likely to work behind the scenes? (Select all that apply.)
snow_tiger [21]

Answer:

The correct option is;

Industrial warehouse

Explanation:

The job functions of an audiovisual technician in industrial warehouses includes;

1) Preparation and testing as well as checking equipment out and checking of equipment back in

2) Movement of equipment into trucks and vans

3) Ensuring the timely completion of tasks

4) Learn the setup and operation of equipment prior to transportation to destination sires

5) Take part in the warehouse administration.

6 0
2 years ago
Your license can be canceled if you __________
Gemiola [76]
Your license can be canceled if you do not have proof of insurance or if you have unpaid tickets or fines. Your license can also be canceled if you are behind in child support payments in Florida.
6 0
2 years ago
Read 2 more answers
Other questions:
  • Suppose you define a java class as follows: public class test { } in order to compile this program, the source code should be st
    14·1 answer
  • True or false? The largest component of a database is a field.
    12·2 answers
  • The navigation bar on the left side of ____ view contains commands to perform actions common to most office programs.
    15·1 answer
  • Ismael would like to insert a question mark symbol in his document. What steps will he need to follow to do that?
    5·2 answers
  • Write a program that simulates the functionality of a vending machine having the following characteristics:• The vending machine
    11·1 answer
  • Assume you have a variable, budget, that is associated with a positive integer. Assume you have another variable, shopping_list,
    11·1 answer
  • As a security engineer, compare and contrast the pros and cons of deploying hetero vs homogenous networks. Which costs more? Whi
    6·1 answer
  • It is also called teleconferencing or web conferencing,which is an online meeting wherein two or more people can see,hear,and ta
    14·1 answer
  • Write a class named Employee that has private data members for an employee's name, ID_number, salary, and email_address. It shou
    7·1 answer
  • 1.erros can easily be ____ 2.work is done in an ____ no mess environment 3.colors do not _____ and brushes are never ______ 4.st
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!