• Create a base class named Calculator containing a property named total with an initial value of 0.0,
and a method for each of the following:
(NOTE: see a description of the functionality for each method below)
• addition - takes a Double argument value, adds it to the total value, and returns the new total
• subtraction - takes a Double value, subtracts it from the total value, and returns the new total
• multiplication - takes a Double value, multiplies it by the total value, and returns the new total
• division - takes a Double value, divides the total value by the new value, and returns the new
total. Include exception handling code to handle errors that might arise when a “division by
zero” error occurs.
• clear - it simply sets the total property value to 0.0
• Create a subclass of the Calculator class named ScientificCalculator
• The ScientificCalculator class must include a property named memory with an initial value of 0.0.
• In addition, the following methods must be implemented in the subclass to extend the functionality
in the Calculator class:
• log - takes a Double value, and returns log of the input value - log(value)
• sin - takes a Double value, and returns sin of the input value - sin(value)
• cos - takes a Double value, and returns cos of the input value - cos(value)
• tan - takes a Double value, and returns tan of the input value - tan(value)
• In the Calculator class, modify the clear method so it will set the total value to 0.0 when it is called.
• In the ScientificCalculator class, override the clear method so it will set the total value to 0.0 when
it is called.
• Override the clear method in the subclass so it will simply extend the existing functionality of the
base method by adding the ability to set the memory property value of the subclass to 0.0
*There is more to it, but I will update
32 freelancere byder i gennemsnit $24 på dette job
Hi, I would like to write the program Calculator for you on C#. You can rely on me. I am an experienced developer. Looking forward to hear from you. Best regards, Dr. Oleh Y.
Very simple project, I could create this class for you in less than a day. Feel free to contact me if you are interested in me completing this project for you, or you have any further questions.