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
Nesterboy [21]
4 years ago
7

Write a function shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than

4, print "Too many.". Else, print "N : Lather and rinse." num_cycles times, where N is the cycle number, followed by "Done.". Sample output with input: 2 1 : Lather and rinse. 2 : Lather and rinse. Done.

Computers and Technology
1 answer:
Rashid [163]4 years ago
3 0

Answer:

The code written in python and fully commented for this question is given below:

# Create the function shampoo_instructions with the num_cycles parameter input

def shampoo_instructions(num_cycles):

   # Condition if is less than 1, print too few

   if num_cycles < 1:

       print("Too few.")

   # Condition if is greater than 4, print too many

   elif num_cycles > 4:

       print("Too many.")

   # If is in inclusive range [1,4], print the Lather and rinse cycle

   else:

       # Create a for loop to print rinse cycle

       for i in range(num_cycles):

           print("{}: Lather and rinse.".format(i+1))

   # Print an end string for each execution

   print("End-------------------------------------")

# Call the function with all the conditions tested

shampoo_instructions(3)

shampoo_instructions(0)

shampoo_instructions(4)

shampoo_instructions(5)

Explanation:

I attach an image that contains the output of the execution and the source code.

You might be interested in
Clunker Motors Inc. is recalling all vehicles from model years 1995-1998 and 2004-2006. Given a variable modelYear write a state
DerKrebs [107]

Answer:

((model years >=1995 && model years <= 1998) || (model years >= 2004 && model years <=2006 ) ? no recall= false : no recall = true;

Explanation:

8 0
3 years ago
Which of the selections below is not a benefit of imaging the computers on your network? There are fewer licensing fees because
Stella [2.4K]
Among the selections, the statement that is not a benefit of imaging the computers on your network is: It helps to lessen the impact of spyware on the network. 
The area that studies covering digital images - images that can be stored on a computer like bit-mapped images is called Computer imaging or digital imaging. 
8 0
3 years ago
If you paste a word document text into an excel spreadsheet, the paste optio allow you to keep source formatting or
castortr0y [4]
I think the answer is c
6 0
3 years ago
What job titles describes a person with green engery? in career clusters
Amiraneli [1.4K]

Answer:

environmental scientist

Explanation:

8 0
3 years ago
Add a function named circle to the polygons module. This function expects the same arguments as the square and hexagon functions
PolarNik [594]

Answer and Explanation:

import Circle

#include<conio.h>

void main ()

int t , length , n

//for hexagon

def hexagon(t, length, n):

 for _ in range(n):

 t.fd(length)

t.lt(360 / n)

square = Circle.Circle()

square.penup()

square.sety(-270)

square.pendown()

hexagon(square, 30, 60)

5 0
3 years ago
Other questions:
  • The c++ operator _______________ is used to destroy dynamic variables.
    5·1 answer
  • Title text boxes on every slide must be the same format.<br><br> A) True<br> B) False
    8·2 answers
  • 12.
    10·1 answer
  • A _____ is inserted so that a portion of a document that can have different formatting from the rest of the document. a. heading
    9·1 answer
  • Are goals that<br> have concrete criteria for measuring<br> progress toward their attainment.
    5·1 answer
  • The Beaufort Wind Scale is used to characterize the strength of winds. The scale uses integer values and goes from a force of 0,
    10·1 answer
  • Which of the following is false? A. The last element of an array has position number one less than the array size. B. The positi
    9·1 answer
  • g The state of Massachusetts at one time had considered generating electric power by harvesting energy crops and burning them. A
    15·1 answer
  • Disadvantages of computer. ​
    9·1 answer
  • Write a line of code that declares a variable called shipName and set it equal to the string SpaceX3000.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!