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
Leviafan [203]
3 years ago
3

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.

So, this is what I have done.
#include
using namespace std;
void PrintShampooInstructions( int numCycles ) {
if (numCycles < 1) {
cout << "Too few." << endl ;
}
if (numCycles > 4 ) {
cout << "Too many." << endl ;
}
else {
int i = 0 ;
int N = 0 ;
for ( i = N ; i < numCycles ; ++i) {
cout << "i: Lather and rinse." << endl ;
cout << "Done." << endl ;
}
}
}
return ;
}
int main() {
PrintShampooInstructions(2);

return 0;
}

Computers and Technology
1 answer:
Mazyrski [523]3 years ago
7 0

Answer:

See explaination

Explanation:

Source code below.

#include <iostream>

using namespace std;

// <STUDENT CODE>

// Define the function PrintShampooInstructions().

void PrintShampooInstructions(int numCycles)

{

// Display "Too few." if the value

// of numCycles is less than 1.

if (numCycles < 1)

{

cout << "Too few." << endl;

}

// Display "Too many." if the value

// of numCycles is greater than 4.

else if (numCycles > 4)

{

cout << "Too many." << endl;

}

// Otherwise, do the following:

else

{

// Define the loop variable.

int N = 1;

// Start the loop from 1 to numCycles.

for (N = 1; N <= numCycles; N++)

{

// Print the value of N followed by "Lather and rinse".

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

}

// Print "Done." followed by newline.

cout << "Done." << endl;

}

}

// Define the main() function.

int main()

{

PrintShampooInstructions(2);

return 0;

}

Please kindly check attachment for sample output and program screen shot.

You might be interested in
8. Which of the following could be measured by defining a goal in Google Analytics?
Slav-nsk [51]

All of these could be measured by defining a goal in Google Analytics is the answer.

Explanation:

  • Google Analytics is a web analytics service offered by Google that tracks and reports website traffic, currently as a platform inside the Google Marketing Platform brand.
  • Google Analytics is one of the most popular digital analytics software. It is Google's free web analytics service that allows you to analyze in-depth detail about the visitors on your website. It provides valuable insights that can help you to shape the success strategy of your business.
  • Google Analytics works by the inclusion of a block of JavaScript code on pages in your website. When users to your website view a page, this JavaScript code references a JavaScript file which then executes the tracking operation for Analytics.
  • The percentage of visits that result in a site registration , conversion rate , the percentage of visits during which visitors spent at least two minutes on the site all define a goal in Google Analytics.

8 0
4 years ago
To add the word "confidential" to the background of a page, users would need to _____.
KengaRu [80]
I beleive you need to insert a watermark
3 0
3 years ago
Digital art is created by using
enyata [817]

Answer:

D. Computers

Explanation:

Digital art is when you make art on electronic devices.

8 0
3 years ago
Suppose you are asked to design a rotating disk where the number of bits per track is constant. You know that the number of bits
Olenka [21]

Answer:

suppose i was i would tell them i dont know and walk away

Explanation:

in thoery this is correct

you said suppose so i answerd

there is no use in reporting or getting this taken down

nether is it right

im not stealing points

Because in thoery its an answer

<em><u>THIS IS MY PROTEST</u></em>

6 0
3 years ago
If you want a smartphone with the fewest restrictions on application development what operation system should you use
butalik [34]
Know ur password to turn the restrictions off 

8 0
4 years ago
Other questions:
  • Reputable firms often ask recent graduates to pay an up-front fee for a job.
    10·2 answers
  • You have just used a command that produced some interesting output on the screen. You would like to save that information into a
    10·1 answer
  • A display that is thin, flexible, light, and easy to read in all types of light is
    9·2 answers
  • Who is responsible for customer service?
    14·1 answer
  • Georgenotfound??? question mark??
    15·2 answers
  • Name the contributions of Steve Jobs and Bill Gates, with respect to technology.
    5·1 answer
  • Create ER Models &amp; Normalization for the following scenarios:
    5·1 answer
  • The first field of an Internet Control Message Protocol (ICMP) packet specifies the message type. Which choices represent messag
    12·1 answer
  • As a network engineer, you have been creating patch (straight-through) cables for a network switch. You have plugged in all the
    11·1 answer
  • What (if any) are the same feature requirements that might be found in server software/OS environments
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!