Quick actions

cmd+k|ctrl+k

Navigation

Languages

classes_practice++

Snippet info

Language

Cpp

Visibility

public

Author

danielmg17

Created

2018-02-12T19:35:17Z

Updated

2018-02-20T19:11:08Z

#include <iostream>
using namespace std;

class Box {
  public:
    double h,w,l;
    Box(double x,double y,double z){h=x;w=y;l=z;}
    Box(){}
    ~Box(){cout << endl << "you haven't seen the last of me";}
    double volume(){return (h*w*l);}
    //int a = []( int b ){ int r=1; while (b>0) r*=b--; return r; }(5);
    friend double mV(Box m);
};
double multiplier=5;

double mV(Box m) {
    return multiplier * m.volume();
}

int main() {
    Box box(5,2,3);
    Box box1;
    box1.h = 1;
    box1.w = 1;
    box1.l = 1;
    cout << box.volume() << endl << box1.volume() << endl;
    cout << mV(box);
}
INFO