19 lines
551 B
C++
Raw Permalink Normal View History

2021-03-28 14:53:22 -04:00
#include <iostream>
#include "Calculator.h"
using namespace std;
double value;
// TODO: Define default constructor
Calculator::Calculator(){
value = 0;
}
// TODO: Define member functions -
// Add(), Subtract(), Multiply(), Divide(), Clear(), GetValue()
void Calculator::Add(double n) { value += n; }
void Calculator::Subtract(double n) { value -= n; }
void Calculator::Multiply(double n) { value *= n; }
void Calculator::Divide(double n) { value /= n; }
void Calculator::Clear() { value = 0; }
double Calculator::GetValue(){ return value; }