The Calculator
The main menu should have the following options:
E - Exit
S - Set Directory
4 - Run 4 function calculator from keyboard input
R - Read single test file and run
D - Distinction/HD level Read a test file and run test
NOTE: the ‘D’ option in my case is identical to the R option since I have all features of memories in the R option – so you don’t need the D option if you are totally confident all is covered in the R option.
For me the R and 4 options do a clear of the calculator before they run this is what I intended, and I would consider good behaviour for your program (effectively like the on/clear key in a four function calculator)
Task 1
The calculator is fixed precision at 2 decimal places
The calculator is to react to keystrokes immediately from the keyboard using _getch() (or getch(), getchar()).
tabs, cr, nl and spaces in test file or input from the keyboard are to be ignored be ignored (whitespace)
assume you only need to type positive numbers. In the CR option use the ! key to reverse sign.
If you type two . (dots) in the number it should not crash.
The calculator in its most basic form should respond to the following keys:
0-9 decimal digits
. decimal point
+ Plus (add key)
- Minus (Subtract key)
* Multiply key
/ Divide key
= Equals key Result key
C (or c) Clears calculator (clear all)
K (or k) Clears calculator display only (CE)
; exit calculator – return to the program menu
K clears the current display and last selected operator.
C clear the memories and code as well as the current display and last selected operator.
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions

Consult our trusted tutors.