Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace Console_App
- {
- class Program
- {
- static void Main()
- {
- var users = new List<User>
- {
- new User
- {
- Username = "rileyhempel",
- Password = "test",
- Email = "rileyhempel@outlook.com",
- Age = "16",
- Height = "5 foot 11 inches",
- Weight = "65kg",
- HairColour = "Blonde",
- EyeColour = "Brown",
- Pet = new Pet()
- {
- Name = "Doggo",
- Type = "Cat"
- }
- },
- new User
- {
- Username = "stephgolland",
- Password = "test2",
- Email = "stephgolland@hotmail.com",
- Age = "16",
- Height = "5 foot 5 inches",
- Weight = "55kg",
- HairColour = "Blonde",
- EyeColour = "Hazel",
- Pet = new Pet()
- {
- Name = "Snip Snap Doggo",
- Type = "Scorpion"
- }
- },
- new User
- {
- Username = "jordanberlyn",
- Password = "test3",
- Email = "jordanberlyn@gmail.com",
- Age = "26",
- Height = "5 foot 10 inches",
- Weight = "70kg",
- HairColour = "Brown",
- EyeColour = "Blue",
- Pet = new Pet()
- {
- Name = "Grizlord",
- Type = "Bear"
- }
- },
- };
- Console.WriteLine("Hello there!");
- Console.WriteLine("Please enter your username.");
- var username = Console.ReadLine();
- var user = users.Find(i => i.Username == username);
- if (user == null)
- {
- Console.WriteLine("Incorrect username. Please try again.");
- Main();
- }
- Console.WriteLine("Please enter your password.");
- var password = Console.ReadLine();
- if (password != user.Password)
- {
- Console.WriteLine("Incorrect password. Please try again.");
- Main();
- }
- Console.WriteLine("You have successfully logged into your account.");
- Console.WriteLine($"Your pets name is {user.Pet.Name} and it is a {user.Pet.Type}");
- Console.WriteLine("Please enter your email for more information about your account.");
- var email = Console.ReadLine();
- if (email != user.Email)
- {
- Console.WriteLine("Incorrect email. Logging out of account.");
- Main();
- }
- Console.WriteLine("You have successfully bypassed all of your accounts security.");
- Console.WriteLine("Well done!");
- Console.WriteLine("Here is some more information about your account.");
- Console.WriteLine($"You are {user.Age} years of age.");
- Console.WriteLine($"You are {user.Height} tall and weigh {user.Weight}.");
- Console.WriteLine($"Your hair colour is {user.HairColour} and your eyes are {user.EyeColour}");
- Console.WriteLine("Press any key then hit 'enter' to log out, or hit 'x' to exit the program.");
- Console.ReadLine();
- Main();
- }
- public class User
- {
- public string Username;
- public string Password;
- public string Email;
- public string Age;
- public string Height;
- public string Weight;
- public string HairColour;
- public string EyeColour;
- public Pet Pet;
- }
- public class Pet
- {
- public string Name;
- public string Type;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement