CIS 150 Lab 3: Repetition – With C++ Code – Perfect Solution – Instant Delivery

Lab Price = $10
Please feel free to send us your queries at: support@iqrajavaid.com
Payment methods

Add to Cart

Buy Now

View Cart


Problem Statement

CIS 150 Lab: Repetition
Objectives
• Create a do-while loop that outputs specific values
• Create a while loop that outputs specific values
• Create a for loop that outputs specific values
• Create a loop that performs input validation
• Create a loop that displays a nicely formatted table of values
Lab requirements
Modify the supplied program (repetitionLab.cpp) to make it work properly.
/*
repetitionLab.cpp
Name:
CIS 150
Date:

CIS 150 Chapter 5 Repetition Lab
*/

/*
Place your name and section at the top in comments.
Read the instructions for each section and then implement
your solution within this program.

You should uncomment sections as you finish them. Declare variables
if necessary. You do not need to get input from the user
unless otherwise specified or that code is already written.
*/

#include
#include
#include
using namespace std;

int main() {
cout << "Part I (while loop)\n"; /* Part 1. Write a while loop that will output the square roots of the numbers from 10 to 20, each on it's own line. */ cout << "\nPart II (do-while loop)\n"; /* Part 2. Write a do-while loop that will output the square roots of the numbers from 10 to 20, each on it's own line. */ cout << "\nPart III (for loop)\n"; /* Part 3. Write a for loop that will output the square roots of the numbers from 10 to 20, each on it's own line. */ cout << "\nPart IV (input validation)\n"; int num = -1; /* Part 4. Write a while loop around the following code that will validate that a user entered value is within the range 1 through 100 by looping until the number the user entered is within that range. */ /* cout << "Enter a number between 1 and 100: "; cin >> num;
*/

cout << "\nPart V (40 column table)\n"; /* Part 5. Using ONE while or for loop, output the numbers from 1 to 100. Each number should be in a field four characters wide and only ten numbers should display on a line. You will have to choose some way to output a newline after every tenth number. There are several different ways to count! a. Create a counter variable. Add one to it each time you output an number. Using a decision structure, if you reach 10 output a newline and start your count over. or b. In a decision structure, use modulus to see if you have reached a number evenly divisible by 10 Your output should look similar to this 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 */ cin.ignore(); cout << "Press enter to continue..."; cin.get(); return 0; } Example run of program Part I (while loop) The square root of 10 is 3.16228 The square root of 11 is 3.31662 The square root of 12 is 3.4641 The square root of 13 is 3.60555 The square root of 14 is 3.74166 The square root of 15 is 3.87298 The square root of 16 is 4 The square root of 17 is 4.12311 The square root of 18 is 4.24264 The square root of 19 is 4.3589 The square root of 20 is 4.47214 Part II (do-while loop) The square root of 10 is 3.16228 The square root of 11 is 3.31662 The square root of 12 is 3.4641 The square root of 13 is 3.60555 The square root of 14 is 3.74166 The square root of 15 is 3.87298 The square root of 16 is 4 The square root of 17 is 4.12311 The square root of 18 is 4.24264 The square root of 19 is 4.3589 The square root of 20 is 4.47214 Part III (for loop) The square root of 10 is 3.16228 The square root of 11 is 3.31662 The square root of 12 is 3.4641 The square root of 13 is 3.60555 The square root of 14 is 3.74166 The square root of 15 is 3.87298 The square root of 16 is 4 The square root of 17 is 4.12311 The square root of 18 is 4.24264 The square root of 19 is 4.3589 The square root of 20 is 4.47214 Part IV (input validation) Enter a number between 1 and 100: -4 Enter a number between 1 and 100: 200 Enter a number between 1 and 100: 53 Part V (40 column table) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 Press enter to continue... Rubric • 2 points: for getting part 1 working properly • 2 points: for getting part 2 working properly • 2 points: for getting part 3 working properly • 2 points: for getting part 4 working properly • 2 points: for getting part 5 working properly

Relevant Material
Screenshots
Lab 3: Screenshot
Lab 3: Screenshot
Instructions
* If you want to purchase multiple products then click on “Buy Now” button which will give you ADD TO CART option.Please note that the payment is done through PayPal.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at support@iqrajavaid.com.
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at support@iqrajavaid.com and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at support@iqrajavaid.com.
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Privacy Policy
We take your privacy seriously and will take all measures to protect your personal information.
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
Refund Policy
Incase you face any issues with the tutorial, please free to contact us on support@iqrajavaid.com
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.
Payment Details
Lab Price = $10
Please feel free to send us your queries at: support@iqrajavaid.com

Payment methods

Add to Cart

Buy Now

View Cart

Leave a Reply