Assignment-4 Calculators;Solution

$30.00 $24.00

Design (Recitation) You will design a solution to the following problem. Make sure to include Understanding the Problem and a Test Table in your design. Please consult the design syllabus for more information. (85 pts) Implementation There are many calculations that computers can help us with. You are to make a calculator program for this…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Description

5/5 – (2 votes)

Design (Recitation)

You will design a solution to the following problem. Make sure to include Understanding the Problem and a Test Table in your design. Please consult the design syllabus for more information.

(85 pts) Implementation

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 calculation should be able to handle floats and ints. It should take the equation on one line as a string.

Example:

What is your equation? 2 + 3

Result: 5

There should be spaces between each operand and operator. The input should be taken as a string. 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. They 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.

Your program should handle all input errors such as a user putting in an invalid character or number. All function bodies must be 15 lines of code or less, including main(). Whitespace and lines with just curly braces do not count in the line count. No global variables or goto functions.

(15 pts)Program Style/Comments

In your implementation, make sure that you include a program header and function headers in your program, in addition to proper indentation/spacing and other comments. Below is an example header to include. Make sure you review the style guidelines for this class, and begin trying to follow them, i.e. don’t align everything on the left or put everything on one line! http://classes.engr.oregonstate.edu/eecs/winter2018/cs161-001/assignments/161_style_guideline. pdf

/*********************************************************************

  • Function:

  • Description:

  • Parameters:

  • Pre-Conditions:

  • Post-Conditions:

*********************************************************************/

(10 pts) Extra Credit

Submit an updated, annotated version of your design. How did your design change between when you submitted for recitation and when you submit for your assignment? Make sure to complete your testing table.

Assignment-4 Calculators;Solution
$30.00 $24.00