Compare commits
No commits in common. "cd0405b0c2588c7dbbf86de524dffefeaee56a44" and "5e98b9d043eddfbc65419a2d250d9be0166c30d8" have entirely different histories.
cd0405b0c2
...
5e98b9d043
|
@ -1,46 +0,0 @@
|
|||
#include <iostream>
|
||||
#include <array>
|
||||
#include <vector>
|
||||
class Cube {
|
||||
|
||||
public:
|
||||
Cube(){}
|
||||
Cube(auto _A, auto _B, auto _C): A(_A), B(_B), C(_C){
|
||||
}
|
||||
public:
|
||||
double EvalVolume(){
|
||||
return A * B * C;
|
||||
}
|
||||
std::array<double, 3> GetAll(){
|
||||
auto tmp {std::array<double, 3>()};
|
||||
tmp[0]=A;
|
||||
tmp[1]=B;
|
||||
tmp[2]=C;
|
||||
return tmp;
|
||||
}
|
||||
void SetAll(auto _A, auto _B, auto _C){
|
||||
A=_A;
|
||||
B=_B;
|
||||
C=_C;
|
||||
}
|
||||
void SetA(double x){
|
||||
A=x;
|
||||
}
|
||||
void SetB(double x){
|
||||
B=x;
|
||||
}
|
||||
void SetC(double x){
|
||||
C=x;
|
||||
}
|
||||
const double& GetA(){
|
||||
return A;
|
||||
}
|
||||
const double& GetB(){
|
||||
return B;
|
||||
}
|
||||
const double& GetC(){
|
||||
return C;
|
||||
}
|
||||
private:
|
||||
double A, B, C, Volume;
|
||||
};
|
Binary file not shown.
|
@ -1,17 +0,0 @@
|
|||
#include "Shapes.h"
|
||||
|
||||
int main(){
|
||||
Cube c;
|
||||
Cube c2(1,4,6);
|
||||
|
||||
std::vector<Cube> Cubes;
|
||||
Cubes.push_back(c);
|
||||
Cubes.push_back(c2);
|
||||
Cubes.push_back(Cube(6,8,9));
|
||||
|
||||
for ( auto x : Cubes){
|
||||
std::cout << x.EvalVolume() << "\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue