Challenge

Project

Project Report:

The four pillars of the object oriented programming are Abstraction, Inheritance, Polymorphism and Encapsulation. I tried to apply all this concepts in my project. Below is the explanation of how I use these concepts in my project.

  • Abstraction: Data abstraction is the process of hiding certain details and showing only essential information to the user. Abstraction in java can be achieved with either abstract classes or interfaces. In the project I have used abstract classes like ‘ArithmaticOperations’ to apply abstraction in my program.
  • Inheritance: Inheritance is the mechanism in which a class called child class can access or inherit the methods and attributes of the other class called parent class. In the project ArithmaticOperations class is inherited by Addition, Subtraction, Multiplication and Division class.
  • Polymorphism: Polymorphism is the mechanism in which a method can perform different operations based on the different objects. Polymorphism in java can be achieved by method overriding and overloading. In the project, the abstract method of the parent ArithmaticOperations class is overridden in child classes Addition, Subtraction, Multiplication and Division. Hence it can perform different operation with respect to the objects of the child classes.
  • Encapsulation: Encapsulation is the mechanism in which the sensitive data is hidden from the users by using different access modifiers. In the project, the all the variables in a class are private, some methods like ‘displayOperations’ and ‘operationHandling’ in Calculator class are also private.

Program Summary:

  1. main module- It consist of –

Calculator class – The class with the main method. It has –

- Main method – To interact with the user.

- StoreNumber() method – To temporary store the number in memory

- retriveNumber() method – To retrieve the stored number from memory.

- displayOperations() method – To display the available operation to the user.

- operationHandling() – To handle the selected operations by the user.

  1. arithmeticOperation module – It consist of –
  • ArithmaticOperations class – It is an abstract class with –

- x – An variable

- y – An variable

- SetXY() method – To set the values of x and y

- getX() method – To get the value of x

- getY() method – To get the value of y

- result() method – An abstract method

  • Addition class – It extends the ArithmaticOperation class and override the result() method of the ArithmaticOperation class.
  • Subtraction class – It extends the ArithmaticOperation class and override the result() method of the ArithmaticOperation class.
  • Multiplication class - It extends the ArithmaticOperation class and override the result() method of the ArithmaticOperation class.
  • Division class - It extends the ArithmaticOperation class and override the result() method of the ArithmaticOperation class.
  1. exponentialOperations module – It consist of –
  • ExponentialOperations class – It is an abstract class with –

- x – An variable

- y – An variable

- SetXY() method – To set the values of x and y

- SetX() method – To set the value of only x

- getX() method – To get the value of x

- getY() method – To get the value of y

- result() method – An abstract method

  • Exponent class – It extends the ExponentialOperations class and override the result() method of the ExponentialOperations class.
  • Squareroot class – It extends the ExponentialOperations class and override the result() method of the ExponentialOperations class.
  • Nthroot class - It extends the ExponentialOperations class and override the result() method of the ExponentialOperations class.
  1. logarithmicOperations module – It consist of –
  • LogarithmicOperations class – It is an abstract class with –

- variable – An variable

- SetVariable() method – To set the value of variable

- getVariable() method – To get the value of variable

- result() method – An abstract method

  • Logarithm class – It extends the LogarithmicOperations class and override the result() method of the LogarithmicOperations class.
  • NaturalLogarithm class – It extends the LogarithmicOperations class and override the result() method of the LogarithmicOperations class.
  1. trigonometricOperation module – It consist of –
  • TrigonometricOperations class – It is an abstract class with –

- angle – An variable

- SetAngle() method – To set the value of angle

- getAngle() method – To get the value of angle

- result() method – An abstract method

  • Sine class – It extends the TrigonometricOperations class and override the result() method of the TrigonometricOperations class.
  • Cosine class – It extends the TrigonometricOperations class and override the result() method of the TrigonometricOperations class.
  • Tangent class - It extends the TrigonometricOperations class and override the result() method of the TrigonometricOperations class.
  • InverseTrigonometricOperations class - It is an abstract class with –

- variable – An variable

- SetVariable() method – To set the value of variable

- getVariable() method – To get the value of variable

- result() method – An abstract method

  • InverseSine class - It extends the InverseTrigonometricOperations class and override the result() method of the InverseTrigonometricOperations class.
  • InverseCosine class - It extends the InverseTrigonometricOperations class and override the result() method of the InverseTrigonometricOperations class.
  • InverseTangent class - It extends the InverseTrigonometricOperations class and override the result() method of the InverseTrigonometricOperations class.
  1. conversions module – It consist of –
  • Conversions class – It is an abstract class with –

- variable – An variable

- SetVariable() method – To set the value of variable

- getVariable() method – To get the value of variable

- result() method – An abstract method

  • Binary_to_Decimal class – It extends the Conversions class and override the result() method of the Conversions class.
  • Decimal_to_Binary class – It extends the Conversions class and override the result() method of the Conversions class.
  1. sipCalculator module – It consist of –
  • SIPCalculation class – It consist of -

- investment – An variable

- annualReturnRate – An variable

- time – An variable

- plan – An variable

- No_of_Investments – An variable

- Compounded_ReturnRate – An variable

- SetVariable() method – To set the values of all the variables of the class.

- sipCalculation method – To calculate the final amount of the Sip based on the plan.

  1. storage module – It consist of –
  • HistoryStorage class – It consist of -

- History_Storage() method – To store all the calculation history in the CalculationHistory.txt file.

- display_History method – To display the calculation history of the calculator.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.