-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCanister.h
38 lines (35 loc) · 1006 Bytes
/
Canister.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
Name: Temitope Oladimeji Samuel Adebayo
I have done all the coding by myself and only copied the code that my professor
provided to complete my workshops and assignments.
*/
#ifndef SDDS_BOX_H
#define SDDS_BOX_H
#include <iostream>
namespace sdds {
class Canister {
char* m_contentName;
double m_diameter; // in centimeters
double m_height; // in centimeters
double m_contentVolume; // in CCs
bool m_usable;
void setToDefault();
void setName(const char* Cstr);
bool isEmpty()const;
bool hasSameContent(const Canister& C)const;
public:
Canister();
Canister(const char* contentName);
Canister(double height, double diameter,
const char* contentName = nullptr);
~Canister();
Canister& setContent(const char* contentName);
Canister& pour(double quantity);
Canister& pour(Canister&);
double volume()const;
std::ostream& display()const;
double capacity()const;
void clear();
};
}
#endif // !SDDS_BOX_H