The goal for this exercise is to write a Calculator
that has the following functionalities (that need to be inplemented in the associated methods):
add(double a, double b)
subtract(double a, double b)
multiply(double a, double b)
divide(double numerator, double denominator)
! return the numerator for possible edge cases !power(double base, double exponet)
calculateSurfaceCircle(double radius)
!Use a double (accessible beyond the scope of the class) called PI
that is equal to 3.1415.The calculator should also preform some logic calculations:
logicOr(boolean a, boolean b)
logicAnd(boolean a, boolean b)
logicNot(boolean a)
Laslty, the calculator should also be able to do calculations for the whole part also known as the integer part of a given double. These methods are named the same as the previous one with the addition of the wordt ‘Int’ at the end of the method name. This should be implemented for the following functionalies: addition, subtraction, mulitplication, division and power. We expect integer outputs for all these methods.
No main()
method is needed for this exercise!
Adapted from Calculator - CafePress1