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

DERIVED CLASS

• 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:

PHP Website and mobile app migration

1. Server migration of web-based and mobile applications2. To fix PHP and IONIC app issues...Read Full Description

payment integrations

need a programer with experience in paypal, stripe, amazon pay and payment integration code for opencart, magento, laravel to review sites and help to launch site live with proper payment codes....Read Full Description

Magento 2 template

We need a skilled Magento 2 template designer to create a new template based on an existing web site....Read Full Description

Development of Custom Google Maps Component

Hi,I am looking to build a component based on Google Maps API.Functionality is as follows:Initially shows 8 location pointers and a list with the locations overlaying the map.On click of a particular location, either from the pointer or from the list, zooms in...Read Full Description

Create an Android App

I need to create an app for my business.But ultimately I need to be able to sell subscriptions for the use of the app.So the app must be created in such a way that one can create different users on the app with different profiles. The idea is that if different...Read Full Description

Microsoft office word template design (only design not the content)

I will use this word document template for any business use IE: business plan, proposal, i will fill later with any desired content, I only need a word template with my own branding.You only have to work on: The cover page Different first page Footer reference...Read Full Description

smart parking system

iot project need mobile app which detects the coordinates of user and sends it to web server which interacts as a middle ware between arduino and sensors and user based on some algorithms...Read Full Description

I need an Android app.I Would like it desined and built it .This app will be used for educational purpose like Current Topics,History,Geography, Videos and other things. I doesn't have Laptop or Pc ,Only i have a Smartphone and I just want to operate

I need an Android app. I would like it designed and built....Read Full Description

 

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