CSCI 261 - Programming Concepts (C++)Summer 2018 - A2 - Pretty Math TablesQuick Links: Canvas | CS @ Mines | Piazza | zyBooks |
|||||||||||||||||||
| Home | Contact | Syllabus | Assignments | Schedule | Resources | | |||||||||||||||||||
This assignment is due by Thursday, May 17, 2018, 11:59 PM. 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 RubricYour submission will be graded according to the following rubric.
This assignment is due by Thursday, May 17, 2018, 11:59 PM. SubmissionAlways, 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:
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 Thursday, May 17, 2018, 11:59 PM. | |||||||||||||||||||
Last Updated: 05/16/18 13:40
|