Question: Implement a calculator class. This will print 5 calculator.subtract(10, 2) -> This will print 8 calculator.subtract(2, 10) -> This will print -8 calculator.multiply(5, 2)-> This

Implement a calculator class. This will print 5 calculator.subtract(10, 2) -> This will print 8 calculator.subtract(2, 10) -> This will print -8 calculator.multiply(5, 2)-> This will print 10 calculator.multiply(5, 4, 2) -> This will print 40 calculator.divide(8, 2) -> This will print 4 calculator.divide(12, 2, 2) -> This will print 3 Note that the number of inputs can vary, it can be 2 or it can be 1000. (add (2. 3) or add (1, 2, 3, 4, 5 6, 7......000) This means that you need to make your function to take dynamic number of inputs. Also, you may change the type of your input. You can make it to take a list (calculator.multiply(12, 4 51)>This will print 40) or whatever you think it is necessary to built a successful calculator class." v:shapes="Picture_x0020_157">

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 Programming Questions!