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
What is the problem with paying only your minimum credit card balance each month​
Vinvika [58]

Answer:

The problem is that each month your credit card balance increases, and it increase by a certain percent of what you already owe. So if you pay the minimum each month, you'll just end up paying more money because it's ever increasing.

Please give brainliest!

6 0
3 years ago
Read 2 more answers
How many generations of computer languages have there been since the middle of the 20th century?
Anuta_ua [19.1K]
4. https://en.m.wikibooks.org/wiki/A-level_Computing/AQA/Computer_Components,_The_Stored_Program_Concept_and_the_Internet/Fundamentals_of_Computer_Systems/Generations_of_programming_language
3 0
3 years ago
Mention five internet services​
sergiy2304 [10]
<h3>1 ) cable internet </h3><h3>2) DSL internet </h3><h3>3) sattalite internet</h3><h3>4) mobile internet</h3><h3>5) BSNL </h3>

<h2>please mark me as brainlist</h2>

7 0
3 years ago
Read 2 more answers
List any three positive impacts of computer technology in our society?
arlik [135]

Answer:

nWhich statement about the origins of the American population is true?

A most Americans descend from people who first populated this continent about 20,000 years ago

b about 98 percent of Americans live in this country due to the waves of Irish and German people who came in mid 1800s

c immigration expander the American population before 1806 ,bur has no significantly contributed to it since then

d the vast majority. of Americans ms either descended from immigrats or are immigrants themselves

Explanation:

sjsikskakakakakkakznxjduwjawjieieiwiwiwiwiwiw idek computer mouse laptopdhsjsjsjsjjsjs

6 0
3 years ago
The data _______________ stores definitions of information types, identifies the primary and foreign keys, and maintains the rel
timofeeve [1]

Answer:

C: Dictionary

Explanation:

The Data dictionary stores definitions of information types, identifies the primary and foreign keys, and maintains relationship between elements that are used in the control of access and for manipulating a database. It is usually a set of information that provides the description of a database's format, contents and structure.

3 0
4 years ago
Other questions:
  • Write a recursive method public static String reverse(String str) that computes the reverse of a string. For example, reverse("f
    6·1 answer
  • Which presidential race has been called “the dirtiest in American history”
    10·1 answer
  • The internet has opened a wide range of new opportunities for small businesses. true or false?
    13·1 answer
  • What width would you choose for the pdf?
    12·1 answer
  • If you want three vertical sections of text on your page, create _____. dividers columns page breaks bulleted lists
    7·2 answers
  • Identify the normalized form of the mantissa in 111.01.
    14·1 answer
  • 3 Points
    15·2 answers
  • Through the use of computational thinking techniques, models and algorithms can be created. A(n) ___1___ can be created that rep
    12·2 answers
  • In video game development, the person who oversees and directs the entire design team and is the key vision keeper is
    13·1 answer
  • To execute a command object and store the results in a dataset, you use the Group of answer choices Fill method of a data adapte
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!