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!)
.
//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>
usingnamespace 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;
}