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
Snezhnost [94]
3 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]3 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]3 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
2 (01.01 LC)
myrzilka [38]

Answer:

They write code that translates commands to binary code.

Explanation:

Coding or programming is the process of creating instructions for computers using programming languages. Computer code is used to program the websites, apps, and other technologies we interact with every day.

4 0
3 years ago
Bob's Assembly is a hardware manufacturer. It specializes in builders' hardware for doors, cabinets, windows, and bathrooms. Bob
Snezhnost [94]

Answer:

distinctive competence

Explanation:

The distinctive competence denotes the various characteristic of certain business on which behalf that business perform better than its competitors. And since the business succeeds in doing those things better than its competitors, that business gains a competitive advantage over its competitors. And here, Bob's assembly is a hardware manufacturer for the doors, cabinets, windows and the bathrooms. And his assembly products are more durable and economical than its competitor's products. And thus Bob has a competitive advantage over its competitors.

3 0
4 years ago
What is the most common type of communication?
tamaranim1 [39]

Answer:

technology texting

Explanation:

omega lol

6 0
3 years ago
If i paid $37.20 for 12 gallons of ice cream how many would 1 quart of ice cream cost
Lapatulllka [165]

Answer:

$0.78

Explanation:

5 0
3 years ago
Read 2 more answers
You have just installed a new NIC in your PC to replace the old one that had started malfunctioning. What additional software mu
miskamm [114]

Answer:

The additional software that must be installed is a device driver.  

Explanation:

Device driver is a software program that is used to control a device connected to a computer.

If a user later buys a new type of device that the operating system did not recognize, new device driver will have to be installed just as in the given question when new NIC is installed. Device driver allows communication between hardware device and operating system.

So device driver will allow the OS to communicate with the new installed NIC.

4 0
3 years ago
Other questions:
  • How can you create balance to your drawing using only grayscale values?
    12·1 answer
  • Where can audiovisual technology and materials be found? (Select all that apply.)
    14·1 answer
  • Which type of computer do dedicated gamers and video editors prefer?​
    11·1 answer
  • There are two kinds of type that you can add to a document in Photoshop. You can add
    13·1 answer
  • _is a computer network created for an individual person
    10·1 answer
  • How do you check how much space is left in current drive?
    9·1 answer
  • Can someone solve this for me please? It’s part of an escape room.
    13·2 answers
  • Question #4
    8·1 answer
  • Which sentence describes a biotechnology method of treating sulfur liquor in the paper industry?
    11·1 answer
  • 1. Wash all work surfaces with a_______ wrung in hot soapy water.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!