Question: Using C++ Write a command line calculator in C++. The calculator supports the following mathmatical operations: Multiplication m Divison d Subtraction s Addition a Percentage

Using C++

Write a command line calculator in C++. The calculator supports the following mathmatical operations:

Multiplication m

Divison d

Subtraction s

Addition a

Percentage p

The following example show cases how this calculator can be used

$ ccalc m 2 40 Ans: 80 

The calculator should also support a commandline option --history, which displays the list of all previous calculations. Check out the following example:

$ ccalc m 2 40 Ans: 80 $ ccalc a 2 3 Ans: 5 

$ ccalc p 2 10 Ans: 20 $ calc --history History: p 2 10 20 a23 5 m 2 40 80

By necessity youll have to use a file to save/load the history. For the purposes of this exercise, lets assume that the history is stored in file ccalc-history.txt sitting in the local directory.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!