...
\uD83D\uDDD2 Requirements
...
Create a class called Calculator
with the following attributes:
first_number (double)
second_number (double)
...
Add the following methods to the Calculator
class:
A constructor to initialize the attributes.
Getters and setters for each attribute.
A method called
add()
to add the two numbers and return the result.A method called
subtract()
to subtract the second number from the first number and return the result.A method called
multiply()
to multiply the two numbers and return the result.A method called
divide()
to divide the first number by the second number and return the result. Ensure that division by zero is handled appropriately.
...
❗Note - your functions for add, subtract, multiple, and divide should not have any parameters❗
You must have a header and implementation file for your class.
🚚 Deliverable
Upload the following:
...