Esempio n. 1
0
    class crush { //! ADDING NEW FUNCTIONS
        public void check()
        {
            Person        Boy  = new Person();
            Person        Girl = new Person();
            personalities perc = new personalities();

            Program.def d = new Program.def();

            if (Program.def.finalGender == "boy")
            {
                Console.Write("Enter your crush's name in : ");
                Girl.name = Console.ReadLine();
                Console.WriteLine();
                while (string.IsNullOrEmpty(Girl.name))
                {
                    Console.WriteLine();
                    Console.WriteLine("Name cant be empty. Please re-enter your crush's name");
                    Girl.name = Console.ReadLine();
                }

                Console.Write("Enter your crush's age : ");
                var ageAsString = Console.ReadLine();
                Console.WriteLine();
                while (!int.TryParse(ageAsString, out Girl.age))
                {
                    Console.WriteLine();
                    Console.WriteLine("Please re-enter your crush's age.");
                    ageAsString = Console.ReadLine();
                }
                perc.lazyPrint();
                Console.Write("Enter your crush's personality here : ");
                Girl.personality = Int32.Parse(Console.ReadLine());
                Console.WriteLine();
                while (string.IsNullOrEmpty(Girl.personality.ToString()))
                {
                    Console.WriteLine();
                    Console.WriteLine("Personality cant be empty. Please re-enter your crush's personality.");
                    Girl.personality = Int32.Parse(Console.ReadLine());
                }

                switch (Girl.personality)
                {
                case 1:
                    Girl.str_personality = "Openness";
                    break;

                case 2:
                    Girl.str_personality = "Conscientiousness";
                    break;

                case 3:
                    Girl.str_personality = "Extraversion";
                    break;

                case 4:
                    Girl.str_personality = "Agreeableness";
                    break;

                case 5:
                    Girl.str_personality = "Neuroticism";
                    break;

                default:
                    Console.WriteLine("Invalid personality. Please reinput it after this line");
                    Girl.personality = Int32.Parse(Console.ReadLine());
                    break;
                }

                Console.WriteLine(Girl.name + " " + Girl.age + " " + Girl.str_personality);
            }
            else
            {
                Console.Write("Enter your crush's name in : ");
                Boy.name = Console.ReadLine();
                Console.WriteLine();
                while (string.IsNullOrEmpty(Boy.name))
                {
                    Console.WriteLine();
                    Console.WriteLine("Name cant be empty. Please re-enter your crush's name");
                    Boy.name = Console.ReadLine();
                }

                Console.Write("Enter your crush's age : ");
                var ageAsString = Console.ReadLine();
                Console.WriteLine();
                while (!int.TryParse(ageAsString, out Boy.age))
                {
                    Console.WriteLine();
                    Console.WriteLine("Please re-enter your crush's age.");
                    ageAsString = Console.ReadLine();
                }
                perc.lazyPrint();
                Console.Write("Enter your crush's personality here : ");
                Boy.personality = Int32.Parse(Console.ReadLine());
                Console.WriteLine();
                while (string.IsNullOrEmpty(Boy.personality.ToString()))
                {
                    Console.WriteLine();
                    Console.WriteLine("Personality cant be empty. Please re-enter your crush's personality.");
                    Boy.personality = Int32.Parse(Console.ReadLine());
                }

                switch (Boy.personality)
                {
                case 1:
                    Boy.str_personality = "Openness";
                    break;

                case 2:
                    Boy.str_personality = "Conscientiousness";
                    break;

                case 3:
                    Boy.str_personality = "Extraversion";
                    break;

                case 4:
                    Boy.str_personality = "Agreeableness";
                    break;

                case 5:
                    Boy.str_personality = "Neuroticism";
                    break;

                default:
                    Console.WriteLine("Invalid personality. Please reinput it after this line");
                    Boy.personality = Int32.Parse(Console.ReadLine());
                    break;
                }

                Console.WriteLine(Boy.name + " " + Boy.age + " " + Boy.str_personality);
            }
        }
Esempio n. 2
0
        public void check()
        {
            Program.def def = new Program.def();
            Console.Write("Enter your gender : ");
            Program.def.gender = Console.ReadLine();
            Console.WriteLine();

            while (string.IsNullOrEmpty(Program.def.gender))
            {
                Console.WriteLine();
                Console.WriteLine("Gender cant be empty. Please re-enter your gender");
                Program.def.gender = Console.ReadLine();
            }

            switch (Program.def.gender)
            {
            case "boy":
                Program.def.finalGender = "boy";
                break;

            case "man":
                Program.def.finalGender = "boy";
                break;

            case "girl":
                Program.def.finalGender = "girl";
                break;

            case "woman":
                Program.def.finalGender = "girl";
                break;

                // default:
                // Console.WriteLine("Unrecognizeable gender. Please Reinput: ");
                // Program.def.gender = Console.ReadLine();
            }
            if (!string.IsNullOrEmpty(Program.def.gender))
            {
                while (string.IsNullOrEmpty(Program.def.finalGender))
                {
                    Console.WriteLine();
                    Console.WriteLine("Gender not recognized. Please reinput: ");
                    Program.def.gender = Console.ReadLine();
                    switch (Program.def.gender)
                    {
                    case "boy":
                        Program.def.finalGender = "boy";
                        break;

                    case "man":
                        Program.def.finalGender = "boy";
                        break;

                    case "girl":
                        Program.def.finalGender = "girl";
                        break;

                    case "woman":
                        Program.def.finalGender = "girl";
                        break;

                        // default:
                        // // Console.WriteLine("Unrecognizeable gender. Please Reinput: ");
                        // // Program.def.gender = Console.ReadLine();
                    }
                }
            }
        }
Esempio n. 3
0
    class user { //! ADDING NEW FUNCTIONS
        public void check()
        {
            Person        Boy  = new Person();
            Person        Girl = new Person();
            personalities perc = new personalities();

            Program.def d = new Program.def();
            if (Program.def.finalGender == "boy")
            {
                //* This part is pretty complicated... OH WHO AM I KIDDING!

                Console.Write("Enter your name in : ");
                Boy.name = Console.ReadLine();
                Console.WriteLine();
                while (string.IsNullOrEmpty(Boy.name))   //? This checks if the input is empty. If it is empty,
                {
                    Console.WriteLine();
                    Console.WriteLine("Name cant be empty. Please re-enter your name"); //? Then it spits out an error
                    Boy.name = Console.ReadLine();                                      //? Reprompt the input
                }

                Console.Write("Enter your age : ");
                var ageAsString = Console.ReadLine();
                Console.WriteLine();
                while (!int.TryParse(ageAsString, out Boy.age))
                {
                    Console.WriteLine();
                    Console.WriteLine("Please re-enter your age.");
                    ageAsString = Console.ReadLine();
                }

                perc.lazyPrint();
                Console.Write("Enter your personality here : ");
                var personaAsStr = Console.ReadLine();
                Console.WriteLine();
                while (!int.TryParse(personaAsStr, out Boy.personality))
                {
                    Console.WriteLine();
                    Console.WriteLine("Personality cant be empty. Please re-enter your personality.");
                    personaAsStr = Console.ReadLine();
                }
                switch (Boy.personality)
                {
                case 1:
                    Boy.str_personality = "Openness";
                    break;

                case 2:
                    Boy.str_personality = "Conscientiousness";
                    break;

                case 3:
                    Boy.str_personality = "Extraversion";
                    break;

                case 4:
                    Boy.str_personality = "Agreeableness";
                    break;

                case 5:
                    Boy.str_personality = "Neuroticism";
                    break;

                default:
                    Console.WriteLine("Invalid personality. Please reinput it after this line");
                    Boy.personality = Int32.Parse(Console.ReadLine());
                    break;
                }
                Console.WriteLine(Boy.name + " " + Boy.age + " " + Boy.str_personality);
            }
            else
            {
                Console.Write("Enter your name in : ");
                Girl.name = Console.ReadLine();
                Console.WriteLine();
                while (string.IsNullOrEmpty(Girl.name))
                {
                    Console.WriteLine();
                    Console.WriteLine("Name cant be empty. Please re-enter your name");
                    Girl.name = Console.ReadLine();
                }

                Console.Write("Enter your age : ");
                var ageAsString = Console.ReadLine();
                Console.WriteLine();
                while (!int.TryParse(ageAsString, out Girl.age))
                {
                    Console.WriteLine();
                    Console.WriteLine("Please re-enter your age: ");
                    ageAsString = Console.ReadLine();
                }
                perc.lazyPrint();
                Console.Write("Enter your personality here : ");
                Girl.personality = Int32.Parse(Console.ReadLine());
                Console.WriteLine();
                while (string.IsNullOrEmpty(Girl.personality.ToString()))
                {
                    Console.WriteLine();
                    Console.WriteLine("Personality cant be empty. Please re-enter your personality.");
                    Girl.personality = Int32.Parse(Console.ReadLine());
                }

                switch (Girl.personality)
                {
                case 1:
                    Girl.str_personality = "Openness";
                    break;

                case 2:
                    Girl.str_personality = "Conscientiousness";
                    break;

                case 3:
                    Girl.str_personality = "Extraversion";
                    break;

                case 4:
                    Girl.str_personality = "Agreeableness";
                    break;

                case 5:
                    Girl.str_personality = "Neuroticism";
                    break;

                default:
                    Console.WriteLine("Invalid personality. Please reinput it after this line");
                    Girl.personality = Int32.Parse(Console.ReadLine());
                    break;
                }

                Console.WriteLine(Girl.name + " " + Girl.age + " " + Girl.str_personality);
            }
        }