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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started