**** Internal Builder is used for build ****
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o program4.o ..\program4.cpp
..\program4.cpp: In function 'int main()':
..\program4.cpp:72:18: error: expected primary-expression before '%' token
Build error occurred, build is stopped
//A red seed will grow into a flower when planted in soil
//temperatures above 75 degrees, other wise it will grow into
//a mushroom.Assuming the temperature meets the conditions
//for a growing flower,planting the red see in wet soil
//will produce a sun flower and planting the red seed in dry
//soil will produce dandelion.
//a blue seed will grow into a flower when planted in soil
//temperatures ranging from 60 to 70 otherwise it will grow
//into a mushroom.Assuming the temperature meets the conditions
//for growing a flower,planting the blue seed in wet soil will
//produce a dandelion and planting the blue seed in dry soil
//will produce a sun flower.
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
//Get seed color
string seedColor = "";
cout << "Enter the seed color(red/blue) : \n";
cin >> seedColor;
//Get temp
int temp = 0;
cout << "Enter the temperature(F) : \n";
cin >> temp;
//Get the 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 is wet
if(soilMoisture == "wet")
{
//Output sunflower
cout << "A sunflower will grow.\n";
}
//If soil is dry
if(soilMoisture == "dry")
{
//Output dandelion
cout << "A dandelion will grow.\n";
}
}
//Otherwise
//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 the soil is wet
if(soilMoisture == "wet"){
//Output dandelion
cout << "A dandelion will grow.\n";
}
//If the soil is dry
if(soilMoisture == "dry")
{
//Output sunflower
cout << "A sunflower will grow,\n";
}
}
//Otherwise
else
{
//Output mushroom
cout << "A mushrom will grow.\n";
}
}
}