Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cmath>
- #include <iomanip>
- #include <string>
- using namespace std;
- class Factor {
- double a;
- double b;
- public:
- void setA(double val);
- void setB(double val);
- double getA()
- double getB();
- double getAB();
- Factor();
- }
- int main() {
- Factor dubs;
- dubs.setA(22);
- dubs.setB(2);
- cout << dubs.getB() << endl << dubs.getA() << endl << dubs.getAB() << endl;
- return 9001;
- }
- void Factor::setA(double val) { a = val; }
- void Factor::setB(double val) { b = val; }
- double Factor::getA() { return a; }
- double Factor::getB() { return b; }
- double Factor::getAB() { return a * b; }
- Factor::Factor() { a = 1; b = 1; }
Add Comment
Please, Sign In to add comment