// Online C++ compiler to run C++ program online
#include <iostream>
//#include <cstdio>
//#include <vector>
//#include <iostream>
//#include <algorithm>
#include <list> // for arra list list<foodIdeams>....
using namespace std;
class Maths {
public:
int oneQty;
int twoQty;
int sumTotal;
int width;
int height;
int length;
int areaTotal;
Maths(int Width, int Height, int Length, int OneQty, int TwoQty){
width = Width;
height = Height;
length = Length;
oneQty = OneQty;
twoQty = TwoQty;
}
int MakeArea(int width, int height, int length) {
areaTotal = width * height * length;
return areaTotal;
}
void printArea() {
cout << "Wigth: " << width << endl;
cout << "Height: " << height << endl;
cout << "length: " << length << endl;
cout << "" << endl;
cout << "Total: "<< areaTotal << endl;
}
int subtraction(int oneQty, int twoQty) {
sumTotal = oneQty - twoQty;
return sumTotal;
}
void printSum() {
cout << "First Qty: " << oneQty << endl;
cout << "Second Qty: " << twoQty << endl;
cout << "" << endl;
cout << "Subtarction Totle: " << sumTotal << endl;
}
};
int main() {
Maths One(4, 10, 13,3,4);
One.MakeArea(3,1,1);
One.subtraction(10, 7);
One.printArea();
One.printSum();
return 0;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter