Okay, donโt laugh but this project gave me so much joy. First of all, I did not realize how capable I was until I did this. I hope this is the right place to put it as I am not seeing other projects on the forumโฆ perhaps Iโm not looking in the right place? Anyway, here goes. My first ever program from scratch. NOT PERFECT OR NECESSARILY HIGH IN DEMAND OF A PROGRAM, but like I said, it brought me joy. It includes, structs, variables, inputs, outputs, loops and only when I took a step back did I realize how much I have learned. Thanks @ivan! Maybe Liz will like it too lol! P.S. There is more complexity I would like to add to it now that itโs actually functional at all. Forgive the limit on options as well as if the entry is invalidโI wanted to put the existing loop within another so that the program could continue to run until it received a valid entryโฆ however, I was met with a mental road block there. IF ANYONE WANTS TO ADD TO IT TO MAKE THAT HAPPEN, PLEASE DO!!! Very exciting!
//program to help decide what outfit to wear based on the occasion
//occasion:attire options are:
//work:business, workout:fitness, datenight:sexy, beach:swimming,
bedtime:comfy
// Intended use of program:
// 1) user must choose the occasion
// 2) program outputs appropriate attire for said occasion
#include <iostream>
#include <string>
using namespace std;
struct Attire{
string theme;
string timeOfDay;
string top;
string bottom;
string shoes;
string extras;
};
void decideAppropriateAttire(Attire a){
cout << "Therefore, the appropriate theme is "<<a.theme<< endl;
cout << "The time of day you'll be wearing your outfit is " <<a.timeOfDay<<endl;
cout << "The appropraite top to wear is a "<<a.top<<endl;
cout << "The appropraite bottom choice is "<<a.bottom<<endl;
cout << "You will also need "<<a.extras<<" to complete your outfit"<<endl;
}
int main()
{
cout << "Hello, I will help you decide the appropriate attire for the desired occasion."<<endl;
string decision = "";
cout << "Choose an occasion from the following options:"<<endl<<
"1. work"<<endl<<"2. workout"<<endl<<"3. date night"<<endl<<"4. beach"<<endl<<"5. bed time"<<endl;
getline(cin,decision);
cout << "The occasion you have chosen is " << decision << "." << endl << endl;
Attire work = {"BUSINESS ATTIRE","morning","blazer","slacks","high heals","laptop"};
Attire workout = {"FITNESS GEAR","morning","tshirt","leggings","running shoes","headphones"};
Attire dateNight = {"SEXY ATTIRE","evening","blouse","jeans","heals","lipstick"};
Attire beach = {"SWIMWEAR","daytime","bikini top","bikini bottoms","flip flops","sunscreen"};
Attire bedTime = {"COMFY ATTIRE", "bedtime","baggy shirt","sweats","socks","netflix"};
Attire occasion [] = {work, workout, dateNight, beach, bedTime};
if (decision == "work"){
decideAppropriateAttire(work);
}
else if (decision == "workout"){
decideAppropriateAttire(workout);
}
else if (decision == "date night"){
decideAppropriateAttire(dateNight);
}
else if (decision == "beach"){
decideAppropriateAttire(beach);
}
else if (decision == "bed time"){
decideAppropriateAttire(bedTime);
}
else {
cout << "That is not a valid option. Please try again."<<endl;
// getline(cin,decision);
}
return 0;
};