Answer:
Here is an updated code for the NewestMultiply.cpp program that uses a do-while loop to print the numbers 0 through 10 along with their values multiplied by 2 and by 10:
Step-by-step explanation:
// NewestMultiply.cpp
// This program prints the numbers through 10 along
// with these values multiplied by 2 and by 10.
#include <iostream>
#include <string>
using namespace std;
int main()
{
string head1 = "Number:";
string head2 = "Multiplied by 2:";
string head3 = "Multiplied by 10:";
int numberCounter = 0;
int byTen = 0;
int byTwo = 0;
const int NUM_LOOPS = 11; // Constant used to control loop
cout << "0 through 10 multiplied by 2 and by 10." << endl;
// Print the headers
cout << head1 << "\t" << head2 << "\t" << head3 << endl;
// Print the numbers
numberCounter = 0;
do {
byTwo = numberCounter * 2;
byTen = numberCounter * 10;
cout << numberCounter << "\t" << byTwo << "\t\t" << byTen << endl;
numberCounter++;
} while (numberCounter < NUM_LOOPS);
return 0;
} // End of main()