CSCI 261 - Programming Concepts (C++)

Spring 2018 - Lab 3B

Quick Links: Canvas | CS @ Mines | Cloud9 | Piazza | zyBooks

|   Home |  Contact |  Syllabus |  Assignments |  Schedule |  Resources   |
This lab is due by Tuesday, February 13, 2018 11:59 PM .

Part I - Development



Today we're going to return to our math roots and compute some multiplication tables. First, you must prompt the user to enter two numbers greater than 1 and less than 11. Continue to prompt them until they enter two valid numbers.

To meet the specifications of Part II below, do not give any prompt such as "Enter a number". The user will know to enter a number. But you must ensure the values are within the proper range and continue to receive input until the number is valid.

Then output a multiplication table. You'll need to print out the column and row headers so we know what two values are being multiplied. Then each cell will be the result of that product. Be sure to have the numbers right aligned with enough space to have all our columns aligned.

A sample run of the program is shown below:

112
5
1
7
     1   2   3   4   5   6   7
 1   1   2   3   4   5   6   7
 2   2   4   6   8  10  12  14
 3   3   6   9  12  15  18  21
 4   4   8  12  16  20  24  28
 5   5  10  15  20  25  30  35

Hint: You'll need a couple of loops to accomplish this task. And recall, the iomanip library will help you with aligning the columns.


Part II - Testing



To ensure your program meets the required specifications, log into the AutoGrader - which must be accessed from the Mines network. Log in with your multipass account. Navigate to our course, Lab3B, multiplyTables. You will see on the right hand side a text editor. Enter your code here. Then hit the "Test" button in the lower left corner.

You'll see a colored bar at the top with each segment denoting a single test. Each test provides a specific input to your program and then compares your output with the expected output. If the bar is green, then the test passed. If the bar is red, then the test failed and you can compare your output with the expected output by hovering over the box. Additionally, if your code has a compiler error it will display the error. Note: the mostly cause for your test not matching is the spacing not being correct. The output does not give the best alignment for the columns, but between all the tests you can deduce where your spacing is off. Update: This Piazza post has the proper spacing for the output of the last test case. If your output in Cloud9 matches this post, then the tests in AutoGrader should follow suit.

Once you have passed all of the tests, press the save icon in the text editor to save your code and then hit the "Submit" button to submit all your tests for grading. You must perform these two steps to receive full credit for this lab.


Lab Submission



You must press "Save" in AutoGrader and "Submit" with all tests passed to receive full credit for this lab.

You will submit your solution to this lab with the rest of A3. Detailed instructions for doing this are posted in Assignment 3.


This lab is due by Tuesday, February 13, 2018 11:59 PM .
Last Updated: 01/25/18 14:34


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0