Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions