help with "IF" statements.

hi i am very new to programming and starting to learn c++
i made this simple program to sort out outcome if set of conditions meets requirements and its giving me an unexpected token error (something very silly and small.) but for the love of god i cannot find out what is wrong..! (sorry about the spellings!)
.
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
131
//problem statement.
//A red seed will grow in to a flower when planted in soil temperatures above 75 degrees, otherwise it will grow in to a mushroom.
//Assuming the temperatures meets the conditions for growing a flower, planting the red seed in wet soil will produce a sunflower 
//and planting the red seed in dry soil will produce dandelion 

// a blue seed will grow in to a flower when planted in soil temperatures ranging from 60 to 70, otherwise it will grow
//in to a mushroom, assuming the temperature meets the condition for growing a flower.
//planting a blue seed wet soil will produce a dandelion and planting the blue seed in dry soil will produce a sunflower.

//write a program that will ask the user to input the seed color, the soil temperature and whether the soil is wet or dry and
//the output what will grow.

//solution!

#include <iostream>
#include <string>

using namespace std;

int main()
{
   
    //get seed color
    string seedColor = "";
    cout << "Enter the seed color (red or blue): \n";
    cin >> seedColor;
        
        //get temperature
    int temp = 0;
    cout << "enter the temperature of the soil (F): \n";
    cin >> temp;
    
        //get soil moisture
    string soilMoisture = "";
    cout << "Enter the soil moisture (wet or dry): \n";
    cin >> soilMoisture;

    
    
        //if red seed
    if (seedColor == "red")
    
    {   
        //if temp >= 75
        if (temp >= 75)
        {
               
            //if soil = wet
            if (soilMoisture == "wet")
                
                {     
                     //output sunflower
                    cout << "A Sunflower will grow! \n";
                }
                 
            
            //if the soil = dry 
            if (soilMoisture == "dry")
            
                {
                    //output dandelion
                    cout << "A Dandelion will grow! \n";
                }
        }
                //otherwise
        else
        
        { 
                    //output mushroom
                cout << "A Mushroom will grow! \n";
        
        }
    }
    
    
       
    
    
    
    //if blue seed
    
    if (seedColor == "blue")
        
    {   
        //if temp is between 60 and 70       
        if (temp >= 60 && temp <= 70);
            
        {      
                //if soil is wet         
                if (soilMoisture == "wet")
                
                    {
                        //output dandelion
                        cout << "A Dandelion will grow! \n";
            
                    }
                
                //if soil is dry
                if (soilMoisture == "dry")
                
                    {
                        //output sunflower
                        cout << "A Sunflower will grow! \n";
                    }
                
        }
    
        //otherwise 
        else
        
        { 
                    //output mushroom
                cout << "A Mushroom will grow! \n";
        
        }

    }
    
    
        else
        
        { 
                    
                cout << "error! \n";
        
        }
    
    
    return 0;
    
}

Last edited on
if (temp >= 60 && temp <= 70); you don't need the ; at the end
thank you very much Yanson. It worked..
Last edited on
Topic archived. No new replies allowed.