The calculator is to react to keystrokes immediately from the keyboard using
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

The calculator is to react to keystrokes immediately from the keyboard using

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.

Hint
ComputerRead a test file and run test: Run the go test command to execute the test, at the command line in the greetings directory. Also, the go test command executes the test functions (where names begin with Test ) in test files (where names end with _test.go). One could add the -v flag to get verbose output which lists all of the tests along with their results....

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.