-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolidProcessing.cpp
More file actions
75 lines (59 loc) · 1.55 KB
/
Copy pathSolidProcessing.cpp
File metadata and controls
75 lines (59 loc) · 1.55 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
#include <iostream>
#include <string>
using namespace std;
void getWaste();
void wasteSeparation();
void energy();
void landfill();
string getYesNo(string question);
int main() {
getWaste();
wasteSeparation();
return 0;
}
void getWaste() {
cout << "Waste Collected Successfully." << endl;
}
string getYesNo(string question) {
string choice;
while (true) {
cout << question;
cin >> choice;
if (choice == "yes" || choice == "no") {
return choice;
} else {
cout << "Invalid input! Please enter yes or no." << endl;
}
}
}
void wasteSeparation() {
string choice = getYesNo("Is the waste Organic? (yes/no): ");
if (choice == "yes") {
energy();
} else {
choice = getYesNo("Is the waste Reusable? (yes/no): ");
if (choice == "yes") {
cout << "Waste is Reused for other applications." << endl;
return;
} else {
choice = getYesNo("Is the waste Recyclable? (yes/no): ");
if (choice == "yes") {
cout << "Waste is Recycled for other applications." << endl;
return;
} else {
landfill();
}
}
}
}
void energy() {
string choice = getYesNo("Does the waste have High Energy? (yes/no): ");
if (choice == "yes") {
cout << "Converted to Bio-Fuel." << endl;
} else {
cout << "Converted to Organic Fertilizer." << endl;
}
}
void landfill() {
cout << "Waste sent to Landfill." << endl;
}