Write C# code - Follow directions

Task/Problem Description:

• 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

Tags: Algorithm, C# Programming
Bid on this Job!


Here are some random jobs:

Need company Christmas party flyer

Can you please make a company Christmas party flyer with the following information. Company Christmas Party Bowlmor Lanes 2405 Park Ave, Tustin, CA 927827-10PM Appetizers, Dinner buffet, Desserts and Drinks will be served Bowling Tournament with cash prize Raf...Read Full Description

Need a business name and logo

Im looking to start a local tour business in the small but busy city of newport Rhode [login to view URL] is a few other companies in town and im looking to grow with a successful name to attract more [login to view URL] a company we would be picking guest up ...Read Full Description

Long-term Motion Graphic Game Advertising Project

We're a game company looking for talented motion graphic design (Adobe After Effects) freelancers to create a number of 20 to 30 second videos to be used as Facebook advertisements for an upcoming game title.Video Type: 20 to 30 second motion graphic vide...Read Full Description

Logo incorporating company values

Looking to incorporate the five business values of Courage, Accountability, Excellence, Respect and Integrity into a logo using the same colors....Read Full Description

Design shirt

I need somone to design a shirt for me...Read Full Description

Design a logo

A subscription based healthy dog food company....Read Full Description

Create Favicon (Website Icon) for Our Website

Hi there, we are a finance company called LazerMoney and we are building a new website. We just need someone to create a Favicon (Website Icon) for this website. This needs to be in-keeping with the LazerMoney logo attached. Cheers, Dom...Read Full Description

Business solutions!!!!

Hi I am looking for an experienced web builder that has the time and patience to build a financial website with educated content and web hosting please I've wasted my time with inexperience web builders on this site I am not looking for someone that'...Read Full Description


© 2005 - 2018 getFreeLancer.com
1314919 contracts/jobs/projects currently available in our database.