#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 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 the soil is wet
if(soilMoisture == "wet")
{
// Output sunflower
cout << "A sunflower will grow.\n";
}
// If the soil is 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 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 mushroom will grow.\n";
}
}
}
#include <iostream>
#include <string>
int main()
{
// Get seed color
std::string seedColor = "";
std::cout << "Enter the seed color (red or blue): \n";
std::cin >> seedColor;
// Get temp
int temp = 0;
std::cout << "Enter the temperature (F): \n";
std::cin >> temp;
// Get the soil moisture
std::string soilMoisture = "";
std::cout << "Enter the soil moisture (wet or dry): \n";
std::cin >> soilMoisture;
// If red seed
if (seedColor == "red")
{
// If temp >= 75
if (temp >= 75)
{
// If the soil is wet
if (soilMoisture == "wet")
{
// Output sunflower
std::cout << "A sunflower will grow.\n";
}
// If the soil is dry
if (soilMoisture == "dry")
{
// Output dandelion
std::cout << "A dandelion will grow.\n";
}
}
// Otherwise
else
{
// Output mushroom
std::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
std::cout << "A dandelion will grow.\n";
}
// If the soil is dry
if (soilMoisture == "dry")
{
// Output sunflower
std::cout << "A sunflower will grow.\n";
}
}
// Otherwise
else
{
// Output mushroom
std::cout << "A mushroom will grow.\n";
}
}
}