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]
1 year 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]1 year 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]1 year 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
Through which of the devices listed are we able to connect to wireless networks? Check all that apply.
Elis [28]

Answer:

All the devices enable us to connect to wireless networks.

Explanation:

The complete question is...

Through which of the devices listed are we able to connect to wireless networks? Check all that apply.

Antenna

Smart TV

Telephone

Radio

Antenna allow us connect to wireless microwave signals either terrestrial or satellite based.

Smart TV allows wireless connection to the internet.

Modern digital telephones known as 'mobile phones' allows wireless connection between users.

Modern radios use digital wireless network to terrestrial and satellite transmitters.

5 0
1 year ago
Which perspective is usually used in process simulations?
emmainna [20.7K]

Answer:

C. Omnipresent

Explanation:

Just took the test on Plato

#PlatoLivesMatter

#YeetLife

7 0
2 years ago
What is an input to the Program Increment Planning process that highlights how Product Management plans to accomplish the Vision
Tatiana [17]

Answer:

Business Context

Explanation:

The input "business context" is an input to Program Increment Planning that helps understand what is the vision in Product Management.

6 0
1 year ago
Writing a program in a language such as c or java is known as _____ the program.
Angelina_Jolie [31]
<span>Writing a program in a language such as c or java is known as coding the program</span>
8 0
2 years ago
Jim is writing a program to calculate the wages of workers in a teddy bear factory.
34kurt

Answer:

The algorithm is as follows;

1. Start

2. Input TeddyBears

3. Input Hours

4. WagebyTeddy = 2 * TeddyBears

5. WagebyHour = 5 * Hours

6. If WagebyHour > WagebyTeddy then

6.1 Print WagebyHour

7. Else

7.1. Print WagebyTeddy

8. Stop

Explanation:

The following variables are used;

TeddyBears -> Number of teddy bears made

Hours -> Number of Hours worked

WagebyTeddy -> Wages for the number of teddy bears made

WagebyHour -> Wages for the number of hours worked

The algorithm starts by accepting input for the number of teddy bears and hours worked from the user on line 2 and line 3

The wages for the number of teddy bears made  is calculated on line 4

The wages for the number of hours worked  is calculated on line 5

Line 6 checks if wages for the number of hours is greated than wages for the number of bears made;

If yes, the calculated wages by hour is displayed

Otherwise

the calculated wages by teddy bears made is displayed

3 0
2 years ago
Other questions:
  • Prove that any amount of postage greater than or equal to 64 cents can be obtained using only 5-cent and 17-cent stamps?
    15·1 answer
  • Splunk uses ________ to categorize the type of data being indexed..
    11·2 answers
  • Which of the following statements is not true about proper tire care? a.If you see a wear bar across the width of the tread whil
    14·2 answers
  • Robert needs to apply formatting from one set of text to multiple other sets of text throughout the document. Which option shoul
    7·1 answer
  • dam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correct
    9·1 answer
  • Jen is trying to discover if a motor has failed windings. What sort of test can she do.
    6·1 answer
  • In below freezing conditions, keep your fuel level at least _________ full to keep moisture from freezing in your gas line.
    13·1 answer
  • In this question, you will experimentally verify the sensitivity of using a precise Pi to the accuracy of computing area. You ne
    14·1 answer
  • What missing condition will give you the output shown?
    8·2 answers
  • You are a security consultant and have been hired to evaluate an organization's physical security practices. All employees must
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!