Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ensure the source code file named Multiply.cpp is open in the code editor. make a counter-controlledwhileloop that uses the loop control variable to take on

  1. Ensure the source code file namedMultiply.cppis open in the code editor.
  2. make a counter-controlledwhileloop that uses the loop control variable to take on the values 0 through 10. Remember to initialize the loop control variable before the program enters the loop.
  3. In the body of the loop, multiply the value of the loop control variable by 2 and by 10. Remember to change the value of the loop control variable in the body of the loop.
  4. Execute the program by clicking theRunbutton. Record the output of this program.

Expected Output

Number: 0Multiplied by 2: 0Multiplied by 10: 0Number: 1Multiplied by 2: 2Multiplied by 10: 10Number: 2Multiplied by 2: 4Multiplied by 10: 20Number: 3Multiplied by 2: 6Multiplied by 10: 30Number: 4Multiplied by 2: 8Multiplied by 10: 40Number: 5Multiplied by 2: 10Multiplied by 10: 50Number: 6Multiplied by 2: 12Multiplied by 10: 60Number: 7Multiplied by 2: 14Multiplied by 10: 70Number: 8Multiplied by 2: 16Multiplied by 10: 80Number: 9Multiplied by 2: 18Multiplied by 10: 90Number: 10Multiplied by 2: 20Multiplied by 10: 100

image text in transcribedimage text in transcribed
MindTap - Cengage Learning - Google Chrome X ng.cengage.com/staticb/ui/evo/index.html?deploymentld=5745321843541161894515201838&eISBN=9781337274609&id=922179167&snapshotld=1960948& Teon v _ Terminal Catalog and Study Tools Controlled while 1 / / Multiply . cpp - This program prints the numbers 0 through 10 along Partner Offers Loop 2 / / with these values multiplied by 2 and by A-Z Rental Options Summary 10 . 3 / / Input: None 4 / / Output: Prints the numbers 0 through 10 College Success Tips In this lab, you use a along with their values multiplied by 2 and counter-controlled while by 10. Career Success Tips loop in a C++ program 5 6 ? Help provided for you. When completed, the program 7 #include Give Feedback should print the numbers 8 #include 0 through 10, along with 9 using namespace std; 10 their values multiplied by 2 11 int main( ) and by 10. The data file 12 { contains the necessary 13 variable declarations and 14 string head1 = "Number: "; 15 some output statements. string head2 = "Multiplied by 2: "; 16 string head3 = "Multiplied by 10: "; 17 int numberCounter; / / Numbers 0 Instructions through 10 18 int byTen; / / Stores the number O 1. Ensure the source code multiplied by 10 19 int byTwo; / / Stores the (? file named number multiplied by 2 Type here to search B 10:10 AM 10/12/2020 LJMindTap - Cengage Learning - Google Chrome X ng.cengage.com/staticb/ui/evo/index.html?deploymentld=5745321843541161894515201838&eISBN=9781337274609&id=922179167&snapshotld=1960948& Teon v _ Terminal Catalog and Study Tools Controlled while 12 { Loop 13 Partner Offers 14 string head1 = "Number: "; A-Z Summary 15 Rental Options string head2 = "Multiplied by 2: "; 16 string head3 = "Multiplied by 10: "; In this lab, you use a 17 College Success Tips int numberCounter; / / Numbers 0 counter-controlled while through 10 Career Success Tips loop in a C++ program 18 int byTen; / / Stores the number multiplied by 10 ? Help provided for you. When 19 int byTwo; / / Stores the completed, the program number multiplied by 2 Give Feedback should print the numbers 20 const int NUM_LOOPS = 10; / / Constant 0 through 10, along with used to control loop their values multiplied by 2 21 and by 10. The data file 22 / / This is the work done in the housekeeping () function contains the necessary 23 cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions