CS 160 - Programming Concepts and Applications

Summer II 2018 - A2 - Pretty Math Tables

Quick Links: Canvas | John Cabot | Piazza | zyBooks

|   Home |  Contact |  Syllabus |  Assignments |  Schedule |  Resources   |

This assignment is due by Friday, July 6, 2018, 11:59 PM.

· Instructions · Rubric · Submission ·


Make it look pretty!



At the end of Lab2A, our program output looked something like:

Enter the acceleration: 4.33
Enter the mass: 9.3
The force is: 40.269
Enter the width: 4
Enter the height: 2
The area is: 8

Which works, but we'd like to be more precise and make values easier to read. Specifically, we want to always display three decimal places and align the decimal points when outputting the results. Using the appropriate I/O manipulators, modify your program from Lab2A to match the following template exactly (substituting the variables for the equations you chose):

    ------------
    Equation #01
    Newton's 2nd Law
    ------------
    Enter the acceleration: 4.33
    Enter the mass: 9.3

    ------------
    Equation #12
    Area
    ------------
    Enter the width: 4
    Enter the height: 2

    /----------------------------------------------------------------\
    |Equation # | Equation Name    | Major   | Variable     | Value  |
    >----------------------------------------------------------------<
    |    01     | Newton's 2nd Law | Physics | Acceleration |  4.330 |
    |           |                  |         |         Mass |  9.300 |
    |           |                  |         |        Force | 40.269 |
    >----------------------------------------------------------------<
    |    12     | Area             | Math    |        Width |  4.000 |
    |           |                  |         |       Height |  2.000 |
    |           |                  |         |         Area |  8.000 |
    \----------------------------------------------------------------/

The equation number displayed corresponds to the number of the equation from the table in Lab2A. The variable names need to be right aligned. The decimal points should be aligned with three decimal places following.

You'll need to use a combination of I/O manipulators and turn settings on/off to accomplish this task. Do not make the table by outputting spaces. Instead be sure to be setting an appropriate width for each column.



Grading Rubric


Your submission will be graded according to the following rubric.

PointsRequirement Description
2 All code submitted properly.
2 All labs completed and submitted
2 In-class exercises completed.
2 Assignment compiles
6 Equation information printed to screen.
6 Table matches formatting specifications.
6 (1) Comments used
(2) Coding style followed
(3) Appropriate variable names, constants, and data types used
(4) Instructions followed
26 Total Points

This assignment is due by Friday, July 6, 2018, 11:59 PM.


Submission


Always, always, ALWAYS update the header comments at the top of your main.cpp file. And if you ever get stuck, remember that there is LOTS of help available. The following instructions are copied from How to Submit Homework.


It is critical that you follow these steps when submitting homework.

If you do not follow these instructions, your assignment will receive a major deduction. Why all the fuss? Because we have several hundred of these assignments to grade, and we use computer tools to automate as much of the process as possible. If you deviate from these instructions, our grading tools will not work. And that makes us very unhappy. And when we're unhappy, we give penalties. Thus, make us happy.


Submission Instructions



Here are step-by-step instructions for submitting your homework properly:
  1. File and folder names are extremely important in this process. Please double-check carefully, to ensure things are named correctly.
    1. The top-level folder of your project must be named Set2
    2. Inside Set2, create 2 sub-folders that are required for this Set. The name of each sub-folder is defined in that Set (e.g. L2A, and A2).
    3. Copy your program main.cpp and supporting files into the subdirectories of Set2 (steps 1-2), zip this Set2 folder (steps 3-4), and then submit the zipped file (steps 5-11) to Canvas.
    4. For example, when you zip/submit Set2, there will be 2 sub-folders called L2A, and A2 inside the Set2 folder, and each of these sub-folders will have a file called main.cpp and nothing else.

  2. You will need to download each project file(s) from Codenvy to your computer.

  3. Using Windows Explorer (not to be confused with Internet Explorer), find the file named "main.cpp" located inside the folder for the particular lab or homework assignment you will submit.

    STOP: Are you really sure you are viewing the correct assignment's folder?

  4. Now, for A2, right click on the main.cpp to copy the file. Then, return to the Set2/A2 folder and right click to paste the file. In other words, put a copy of your homework's main.cpp source code and supporting files into the Set2/A2 folder.

    Follow the same steps for L2A, to put a copy of your lab's main.cpp and supporting files into the Set2/L2A folder.

    STOP: Are you sure your Set2 folder now has all your code to submit?

  5. Now, right-click on the "Set2" folder.
    1. In the pop-up menu that opens, move the mouse "Send to..." and expand the sub-menu.
    2. In the sub-menu that opens, select "Compressed (zipped) folder".

    STOP: Are you really sure you are zipping a Set2 folder with sub-folders that each contain a main.cpp file in it?

  6. After the previous step, you should now see a "Set2.zip" file.

  7. Now visit the Canvas page for this course and click the "Assignments" button in the sidebar.

  8. Find Set2, click on it, find the "Attach file" area, and then click the "Browse My Computer" button.

  9. Find the "Set2.zip" file created earlier and click the "Open" button.

    STOP: Are you really sure you are selecting the right homework assignment? Are you double-sure?

  10. WAIT! There's one more super-important step. Click on the blue "Submit" button to submit your homework.

  11. No, really, make sure you click the "Submit" button to actually submit your homework. Clicking the "Open" button in the previous step kind of makes it feel like you're done, but you must click the Submit button as well! And you must allow the file time to upload before you turn off your computer!

  12. Canvas should say "This assignment is complete. Click OK to review the results.". Click "OK" and view the files within the zip file you submitted. In other words, verify you submitted what you think you submitted!
In summary, you must zip the "Set2" folder and only the "Set2" folder, this zip folder must have several sub-folders, you must name all these folders correctly, you must submit the correct zip file for this homework, and you must click the "Submit" button. Not doing these steps is like bringing your homework to class but forgetting to hand it in. No concessions will be made for incorrectly submitted work. If you incorrectly submit your homework, we will not be able to give you full credit. And that makes us unhappy.


This assignment is due by Friday, July 6, 2018, 11:59 PM.

Last Updated: 05/16/18 21:40


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