-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtes.cpp
More file actions
133 lines (86 loc) · 2.42 KB
/
tes.cpp
File metadata and controls
133 lines (86 loc) · 2.42 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//A Red seed will grow into a flower when planted in soil tempratures above 75 d,
//otherwidse it will grow into a mushroom. Assuming the temo meets the condition for
//growing a flower, planting the red seed in wet soil produces a sunflower and
//planting the rerd seed in dry soil will produce dandelion.
//
//A blue seed will grow into a flower when planted in soil tempratures ranging
//from 60 to 70 d,otherwidse it will grow into a mushroom.
//Assuming the temo meets the condition for growing a flower,
//planting the blue seed in wet soil produces a dandelion and
//planting the rerd seed in dry soil will produce a sunflower.
//
//Write a program that will ask the user to iunout the seed color, the soil temp
//and wether the soil is wet or dry adn then output what will grow.
#include <iostream>
#include <string>
using namespace std;
int main()
{
//Ask the user for the seed color
string color1 = " ";
cout << "Type the Color of Seed you want ?\n " << "Red or Blue\n";
getline(cin, color1);
//Get temp from user
double temp1 = 0;
cout << "Type in the temp:\n" ;
cin >> temp1;
//Get soil moisture from user.
string moist1 = " ";
//if Red seed actions
if(color1 == "Red" || color1 == "red")
{
//If Temp >= 75
if(temp1 >= 75)
{
cout << "Type the Soil moisture:\n" << "Wet or Dry ?\n\n";
cin >> moist1;
//If soil is wet
if(moist1 == "Wet")
{
//outpout sunflower
cout << "According to your selected options you will grow a sunflower\n";
//If soil is dry
}
else if(moist1 == "Dry")
{
//output dandelion
cout << "You will grow a dandelion\n";
}
}
//otherwise
else
{
//output mushroom
cout << "According to your options the Temp below 75 d will grow a Mushroom\n";
}
}
//if blue seed actions
else if(color1 == "Blue" || color1 == "blue")
{
//If temp is between 60 and 70
if(temp1 >= 60 and temp1 <=70)
{
cout << "Type the Soil moisture:\n" << "Wet or Dry ?\n\n";
cin >> moist1;
//if soil is wet
if(moist1 == "Wet")
{
//output dandelion
cout << "According to your options you will grow a dandelion\n";
}
//if soil dry
else if(moist1 == "Dry")
{
//output sunflower
cout << "According to your options you will grow a sunflower\n";
}
//otherwise
else
{
//output mushroom
cout << "According to your options the temp below ranging from 60 -70 d will grow a Mushroom\n";
}
}
}
return 0;
}