Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace HelloWorld
- {
- class Program
- {
- static void Main(String[] args)
- {
- var users = new List<User>
- {
- new User
- {
- Username = "hempdaddy",
- Password = "2401",
- EmailAddress = "rileyhempel@outlook.com",
- Pet = new Pet()
- {
- Name = "Doggo",
- Type = "Cat"
- }
- },
- new User
- {
- Username = "Stephyyy",
- Password = "rileyissexy69",
- EmailAddress = "stephisalsosexy@bigdick.com.au",
- Pet = new Pet()
- {
- Name = "Pupper",
- Type = "Turtle"
- }
- }
- };
- 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 reset the program and try again.");
- Console.ReadLine();
- return;
- }
- Console.WriteLine("Please enter your password:");
- var password = Console.ReadLine();
- if (password != user.Password)
- {
- Console.WriteLine("Incorrect Password. Please reset the program and try again.");
- Console.ReadLine();
- return;
- }
- 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.ReadLine();
- }
- }
- public class User
- {
- public string Username;
- public string Password;
- public string EmailAddress;
- public Pet Pet;
- }
- public class Pet
- {
- public string Name;
- public string Type;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement