subject

Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, print "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;
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:10
Select the correct answer. emma, the quality control manager in a software development company, asks the testing team to check whether the user interface is friendly. to which type of testing is emma referring? a. usability testing b. data comparison c. validation testing d. stress testing e. destruction testing
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What is used to analyze and summarize your data without graphical support
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
Answers: 1
You know the right answer?
Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If...
Questions
question
Mathematics, 09.12.2020 01:20
Questions on the website: 13722367