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
lys-0071 [83]
3 years ago
14

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 with input 2: 1: Lather and rinse. 2: Lather and rinse. Done. Hint: Declare and use a loop variable.

Computers and Technology
2 answers:
PSYCHO15rus [73]3 years ago
6 0

// Writing a C++ function

void PrintShampooInstructions(int numCycles){

if(numCycles < 1) // if  condition stands

cout<< "To few";

else if(numCycles >4)

cour<<"Too Many";

else{

// looping the variable for desired out put

for(int i=0;i<numCycles;i++)

cout<<i<<":"<<" Lather and rinse."<<endl;

}

}

valkas [14]3 years ago
4 0

Answer:

public static void printShampooInstructions(int numOfCycles){

    if(numOfCycles < 1){

       System.out.println("Too few.");

     }

     else if(numOfCycles > 4){

        System.out.println("Too many.");

     }

     else {

        for(int index = 0; index < numOfCycles; ++index){

        System.out.println((index + 1) + ": Lather and rinse.");

     }

     System.out.println("Done.");

    }

  }

Explanation:

You might be interested in
Which of the following describes the purpose of project management? planning and organizing resources to meet a goal arranging t
True [87]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The question is about selecting the option among given options that best describes the purpose of project management.

The correct option of this question is the purpose of project management is planning and organizing resources to meet a goal.

Because project management is all about planning and organizing resources of a project to meet project goals.

Other options are not correct,

because arranging the order of tasks in a project, presenting data in an organized manner, and producing a quality project- all come under project management- are parts of planning and organizing steps of project management.

4 0
2 years ago
A _______________ is a particular type of network that uses circuits that run over the Internet but that appears to the user to
ArbitrLikvidat [17]

Answer:

A virtual privte network is a particular type of network that uses circuits that run over the Internet but that appears to the user to be a private network.

5 0
2 years ago
The a0 is the part of the central processing unit that performs arithmetic calculations for the computer.
Serga [27]

Answer:

It is the ALU or the Arithmetic Logic Unit.

Explanation:

It is the ALU. However, keep in mind that registers and buses do a very important task. The number of registers we have, faster is the processing, and the opposite is true as well. And there is a reason behind this if we have different channels for sending and receiving the data from the memory, and several registers for storing the data, and we can formulate the requirement seeing the requirements for full adder and half adders. Remember we need to store several variables in case of the full adder, and which is the carry, and if we have separate registers for each of them, our task becomes easier. Remember its the CU that tells the ALU what operation is required to be performed. Also remember we have the same channel for input and output in the case of Van Neumann architecture, as we have a single bus. and we also have a single shared memory. And Harvard architecture is an advanced version of it.

6 0
2 years ago
Part B: Find the value of G: if A = 3, b=4, and C = 5.
antiseptic1488 [7]

Answer:

G=(A^3 + B) * 4-c^2

To calculate G if A=3, b=4 and C=5

cobegin

p1: A^3 = 27

P2:C^2 =25

P3: p1 +B =31

P4:P3*4 =124

P5:P4-P2 =99

coend

Explanation:

One operation is performed at a time, and on the basis of priority as we have only one processor.

6 0
3 years ago
A network router connects multiple computers together and allows them to send messages to each other. If two or more computers s
Sedbober [7]

Answer:

C = M0(M1+M2+M3)+M1(M2+M3)+M2M3 is the equation which suits

Explanation:

From the given data we can state that we need to activate only one product i.e 1------>activated 0-------->means inactivated and also only one slot is activated at a time.The resultant will be no data inputs n control bits and 2 to the power n output bits.

8 0
3 years ago
Other questions:
  • We can see spreadsheet results graphically by creating:
    15·1 answer
  • We will pass in a value N. Write a program that outputs the complete Fibonacci sequence for N iterations. Important: If N is 0,
    13·1 answer
  • The cylinder head and engine block are completely sealed by a A. valve seal. B. head gasket. C. intake manifold. D. spark plug
    11·2 answers
  • What is the traditional cognitive perspective ofHCL?
    12·1 answer
  • For this project you will write a Java program that will run a simple math quiz. Your program will generate two random integers
    15·1 answer
  • Transitive spread refers to the effect of the original things transmitted to the associate things through the material, energy o
    6·1 answer
  • How will you maintain electrical tools and equipment?
    12·2 answers
  • Aaaaaaaaaaaaaaaaplssssssssssssssssssssssssssssshelpppppppppppppppppppppppp
    11·2 answers
  • Which of the following best describes your sequence of actions when developing a web page?
    12·1 answer
  • I want the answer of this task ( using prolog language ) ASAP because the deadline is tomorrow. Please help :"
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!