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]
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
Define the acronym WAECUP and its components
Mariana [72]

WAECUP stands for waste, accident, error, crime, and unethical practices.

Assuming that the components are the same as what's included in the acronym, that should be your answer.

Hope this helps!

8 0
2 years ago
Which of the following commands would I use to begin a new presentation?
ki77a [65]

Answer:

begin >new

Explanation:

just trust me ok hehe

7 0
3 years ago
You use the Paste Options button labeled ____ if you want the pasted chart not to be linked to the source document and you want
Semenov [28]

Answer:

Keep Source Formatting & Embed Workbook

Explanation:

Source formatting is used to apply the formatting from source document while copying and pasting.

Source is the place where the data is already placed and we want to move it make a copy of it on some other document. So if we don't want to change the formatting of source document, we choose source formatting from the options while pasting.

Embed is used to whenever we don't want to link the formatting with source document.

So,

You use the Paste Options button labeled <u><em>Keep Source Formatting & Embed Workbook</em></u><em> </em>if you want the pasted chart not to be linked to the source document and you want the pasted chart to keep the formatting from the source document.

8 0
2 years ago
Read 2 more answers
What is the downside of wider channel bandwidth?
Lana71 [14]

Answer: Wider channel bandwidth has several downside or disadvantages to it. Some of these are as follow:

a) Higher channel bandwidth means lower will be the number of channels being utilized.

b) Wider bandwidth may lead to an increase in the speed but on the other hand, it'll lead to several interference problems.

6 0
2 years ago
Create a flowchart that assigns a counselor to a student.
Nataly [62]
Please Help! Unit 6: Lesson 1 - Coding Activity 2
Instructions: Hemachandra numbers (more commonly known as Fibonacci numbers) are found by starting with two numbers then finding the next number by adding the previous two numbers together. The most common starting numbers are 0 and 1 giving the numbers 0, 1, 1, 2, 3, 5...
The main method from this class contains code which is intended to fill an array of length 10 with these Hemachandra numbers, then print the value of the number in the array at the index entered by the user. For example if the user inputs 3 then the program should output 2, while if the user inputs 6 then the program should output 8. Debug this code so it works as intended.

The Code Given:

import java.util.Scanner;

public class U6_L1_Activity_Two{
public static void main(String[] args){
int[h] = new int[10];
0 = h[0];
1 = h[1];
h[2] = h[0] + h[1];
h[3] = h[1] + h[2];
h[4] = h[2] + h[3];
h[5] = h[3] + h[4];
h[6] = h[4] + h[5];
h[7] = h[5] + h[6];
h[8] = h[6] + h[7]
h[9] = h[7] + h[8];
h[10] = h[8] + h[9];
Scanner scan = new Scanner(System.in);
int i = scan.nextInt();
if (i >= 0 && i < 10)
System.out.println(h(i));
}
}
4 0
2 years ago
Read 2 more answers
Other questions:
  • How do smart watches affect the business and its position in the global marketplace?
    12·2 answers
  • What are some consequences of internet addiction​
    9·1 answer
  • Sometimes we write similar letters to different people. For example, you might write to your parents to tell them about your cla
    9·1 answer
  • What computer system was the first to run the unix operating system?
    11·1 answer
  • A musical compact disc is an example of
    13·1 answer
  • Which of the following is a valid format symbol in Microsoft Excel? Dollar Sign, Comma, Percent Sign or all of them? I can't fig
    14·1 answer
  • Match each scenario to the absolute value expression that describes it. 1. the distance moved when going backwards five spaces i
    13·2 answers
  • Create the following new exceptions: PokemonException, which extends the Exception class. It must have a no-parameter constructo
    13·1 answer
  • I need a computer science help.....and I rlly want it right now...this the question
    10·1 answer
  • You are setting up a home network for your friend. She has students visiting her home regularly for lessons and wants to provide
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!