Implement a scientific calculator using MVC constructs in Swift 3 Programming la
ID: 3794885 • Letter: I
Question
Implement a scientific calculator using MVC constructs in Swift 3 Programming language(basic calculator IOS app). It needs to have two classes. One class name is CalculatorBrain.swift for model and another is ViewController.swift for view. Also please show the screenshot of storyboard.
Requirements:
It needs to be able to handle multiple operations in a sequence.
It should ONLY use the last operand if multiple operands are entered consecutively
Example: “5++-1=”is equivalent to “5-1=”
Proper error handling and self-correction.
“+-5” is equivalent to “negative 5”
“0004+32 ++ 0101 -- 04=” is equivalent to “4+32+101-4=”
Implement 3 more buttons: ¼ ½ and ¾ at the bottom of the keyboard. The fractions should concatenate the number just typed in such as 24.75. In the case where an enter is in between this would be a 24 and then a .75 separately put in the stack.
Add a memory function to your calculator that stores and retrieves a number. Implement the following buttons at the top of the keyboard
MC = Memory clear sets memory to 0
MR – Memory recall uses the number in memory acting as it you typed that number in yourself
MS – Memory Store puts the number on display into memory
M+ – Memory takes the number on the display, adds it to the memory, and puts the result into memory.
Implement a clear (C) button. Put it to the left of the 0. If the clear button is pressed once, it should take whatever was typed before the last enter and put it to 0. If the clear is entered twice, it should clear the stack.
Implement a percent (%) button.
Show the history of every operand and operation input by displaying it.
Explanation / Answer
package Model;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.