-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelement_functions.hpp
More file actions
108 lines (80 loc) · 2.62 KB
/
element_functions.hpp
File metadata and controls
108 lines (80 loc) · 2.62 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#ifndef element_functions_hpp
#define element_functions_hpp
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <stdio.h>
using namespace std;
namespace periodic_elements{
template<class T>
struct node{
T atom;
string symbol;
string name;
float mass;
string matter;
string category;
T family;
node* next;
};
template<class T>
class element{
public:
element();
~element();
void set_symbol(T user_data, string user_symbol);
void set_name(T user_data, string user_name);
void set_mass(T user_data, float user_mass);
void set_matter(T user_data, string user_matter);
void set_category(T user_data, string user_category);
void set_family(T user_data, T user_family);
void add(T user_data, string user_symbol, string user_name, float user_mass, string user_matter, string user_category, T user_family);
void delete_node(T user_data);
void find(T user_data);
void display();
void check_atomexists(T user_data, bool &already_exists);
void check_symbolexists(string user_symbol, bool &already_exists);
void check_namexists(string user_name, bool &already_exists);
void has_gas(T user_data, bool &gas_exist);
void sum_group(T user_family);
private:
node<T>* current;
node<T>* temp;
node<T>* header;
};
}
//exam linked lists
namespace gas_elements{
template<class T>
struct node{
T atom;
string symbol;
string name;
float mass;
string matter;
string category;
T family;
node* next;
};
template<class T>
class gas_element{
public:
gas_element();
~gas_element();
void set_symbol(T user_data, string user_symbol);
void set_name(T user_data, string user_name);
void set_mass(T user_data, float user_mass);
void set_matter(T user_data, string user_matter);
void set_category(T user_data, string user_category);
void set_family(T user_data, T user_family);
void add(T user_data, string user_symbol, string user_name, float user_mass, string user_matter, string user_category, T user_family);
void delete_node(T user_data);
void display();
private:
node<T>* current;
node<T>* temp;
node<T>* header;
};
}
#endif