Computers and Technology

C++: In this lab the completed program should print the numbers 0 through 10, along with their values multiplied by 2 and by 10. You should accomplish this using a for loop instead of a counter-controlled while loop. Instructions: Write a for loop that uses the loop control variable to take on the values 0 through 10.
In the body of the loop, multiply the value of the loop control variable by 2 and by 10.
previous code to work from:
#include
#include
using namespace std;

int main()
{

string head1 = "Number: ";
string head2 = "Multiplied by 2: ";
string head3 = "Multiplied by 10: ";
int numberCounter; // Numbers 0 through 10
int byTen; // Stores the number multiplied by 10
int byTwo; // Stores the number multiplied by 2
const int NUM_LOOPS = 10; // Constant used to control loop

// This is the work done in the housekeeping() function
cout << "0 through 10 multiplied by 2 and by 10." << endl;

// This is the work done in the detailLoop() function
// Write your for loop here.
for (numberCounter = 0 to NUM_LOOPS
// This is the work done in the endOfJob() function
return 0;
} // End of main()

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 21:30, aesthetickait
How do you take a green screen out of the video while editing?
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, xojade
Which of these is an example of an integrated presentation? a. a table created in powerpoint b. an image pasted into powerpoint c. a caption created in powerpoint d. an excel chart pasted into powerpoint
Answers: 1
image
Computers and Technology, 24.06.2019 07:30, sunny644
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
image
Computers and Technology, 25.06.2019 00:30, marziel24
Which type of cell references are locked and not automatically updated when it’s copied a)formula b)relative c)absolute d)worksheet
Answers: 1
Do you know the correct answer?
C++: In this lab the completed program should print the numbers 0 through 10, along with their value...

Questions in other subjects:

Konu
Health, 18.12.2020 07:20
Konu
Mathematics, 18.12.2020 07:20