Project 1 - Choosing the right attire

:slight_smile: :upside_down_face: :slight_smile: :upside_down_face: :smiley: :necktie: :bikini: :high_heel: :lipstick: :socks: :full_moon_with_face: :new_moon_with_face:
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;

};
1 Like

Hello @kyliezz, hope you are great.

I have moved your topic to the proper category, so the community can reach you easily.

Also I have test your code and looks amazing to be honest! Congratulations! :partying_face:

If you have any more questions, please let us know so we can help you! :slightly_smiling_face:

Carlos Z.

2 Likes

Hello! Well I am definitely great now, after receiving such a compliment! Thank you for testing my code! And thank you as well for your assistance with moving my topic to the proper category. Finally F I N A L L Y figured out GitHub holy molyโ€ฆ The project is there as well for anyone who wants to see or add to it.
https://github.com/kyliezz/choosing-the-right-attire

1 Like