Program #4 Designing Your Own Calculator

$24.99 $18.99

There are many calculations that computers can help us with. You are to make a calculator program for this assignment which will allow users to do standard calculations (+, -, *, /), binary to decimal conversion, decimal to binary conversion and a grade calculator. The user should have the option to choose which form of…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)

There are many calculations that computers can help us with. You are to make a calculator program for this assignment which will allow users to do standard calculations (+, -, *, /), binary to decimal conversion, decimal to binary conversion and a grade calculator. The user should have the option to choose which form of calculation they want to do. At the end of each calculation, the user should be asked if they want to do another calculation or exit the program.

The standard calculator should be able to handle floats and ints. It should take the equation on one line as a string.

For an example of the standard calculation:

What is your equation? 5 * -7

Result: -35.

Clarification (10/23/18): Here is an example that illustrates the requirement mentioned below that “…there should not be competing precedence. Everything will be calculated left to right.” In essence, you just have to

process the operators as you encounter them. This makes the assignment easier, rather than having to implement the normal mathematical order of operations.

What is your equation? 6 + 4 / -2.5 – 5.25

Result: -9.25

Explanation:

6+4=10

10 / -2.5 = -4

-4 – 5.25 = -9.25

Addi onal Requirements

Clarification (10/23/18): Your code should detect cases where the number or ordering of operands is incorrect. For example, the calculation “6 + 4.125 + 7 9” would display an error, as would “6 + / 6”. There should be spaces between each operand and operator. Clarification (10/24/18): You can assume that the user will include these spaces (e.g. the TAs will not test the calculator portion of your code with input strings that don’t contain spaces).

There should not be competing precedence. Everything will be calculated left to right.

The binary conversions will only handle unsigned, positive values.

The grade calculator should prompt for the number of grades to be entered, collect those grades from the user and average them. The user should also be given an option to calculate a weighted average. For this option the program will need to take a weight from the user and multiply it by the average. If you are unfamiliar with weighted averages, see the introduction at: https://www.wikihow.com/Calculate-Weighted-Average (https://www.wikihow.com/Calculate-Weighted-Average)

Clarification (10/29/18): For the weighted average calculation, it is sufficient for your code to accept a set of grades and associated weights to be applied.

Example for that part of the program:

You chose to compute a weighted average.

How many entries need to be averaged?

4

Please enter grade #1:

88

Please enter weight #1:

.25

Please enter grade #2:

95.6

Please enter weight #2:

.30

Please enter grade #3:

79w

Oops, invalid input.

Please enter grade #3:

79

Note that there are two deadlines for this assignment.

Your design document must be scanned and electronically submitted to Canvas (in the assignment tab) by Sunday, October 28th, 11:59pm. You may use one of the document scanners (available in KEC1130 and some other College of Engineering labs) to scan your paper design into a PDF document that can be submitted to Canvas.

Electronically submit your C++ source code to TEACH (https://engineering.oregonstate.edu/teach) by the assignment due date on Sunday, November 4th, 11:59pm. Your TEACH submission should contain the

.cpp file with your source code. If you choose to do the extra credit, you may also include a PDF file with your annotated program design and a list of the changes made to your design.

Reminder

Every assignment in this course is graded by demoing your work for 10 minutes with a TA. You are required to meet with a TA within two weeks of the due date to demo. You can schedule a demo with a TA from the TA Office Hours tab in Canvas. The available times can be viewed in the far right column of the table (labeled “Grading Hours”). Click on one of the links to access the poll and insert your name in a specific time slot.

Demo Outside 2 Weeks: Assignments that are not demo’d within the acceptable time period will be subject to a 50 point deduction.

Demo Late Assignments: Late assignments must still be demoed within the two week demo period beginning from the assignment’s original due date.

Missing a Demo: If you miss your demo with a TA, you will receive a 10 point (one letter grade) deduction to that assignment for each demo missed.

Each program needs to be written according to the style guidelines

(https://web.engr.oregonstate.edu/~goinsj/resources/general/cpp_style_guideline.pdf) for this class. Remember that an important part of computer programming is making sure that your work is easily understandable by other programmers.

Program #4 Designing Your Own Calculator
$24.99 $18.99