Question: Take the pseudocode and write working C++ code. Where you see ellipses ( ... ) add comments and print statements to explain what the code
Take the pseudocode and write working C++ code. Where you see ellipses (...) add comments and print statements to explain what the code is doing. For example
// create a loop variable
cout << "variableName is " << variableName << endl; // inside loop cout << "in loop, variableName is " << variableName << endl; // loop execution complete cout << "loop complete, variableName is " << variableName << endl;
These are called debugging print statments, they can help in debugging logic errors and determining program flow.
char continueLoop = 'y'; ... while (continueLoop == 'y') { ... prompt user to continue (y/n) store user input in continueLoop } ... |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
