Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
3.3 kB
16
Indexable
Never
using System;
using System.Collections.Generic;

class Program
{
    class User
    {
        
        public string FirstName0 { get; set; }
        public string MiddleInitial0 { get; set; }
        public string LastName0 { get; set; }
        public string Gender0 { get; set; }
        public string Specialty0 { get; set; }
        public string PhilosophyLife0 { get; set; }
        public string JobObjective0 { get; set; }
        
    }

    static List<User> temporaryDatabase = new List<User>();

    static void Main(string[] args)
    {
        while (true)
        {
            Console.WriteLine("Applicant's Basic Info:");
            Console.WriteLine("1. Add User");
            Console.WriteLine("2. List Users");
            Console.WriteLine("3. Exit");
            Console.Write("Enter your choice: ");

            if (int.TryParse(Console.ReadLine(), out int choice))
            {
                switch (choice)
                {
                    case 1:
                        AddUser();
                        break;
                    case 2:
                        ListUsers();
                        break;
                    case 3:
                        return;
                    default:
                        Console.WriteLine("Invalid choice. Please try again.");
                        break;
                }
            }
            else
            {
                Console.WriteLine("Invalid input. Please enter a number.");
            }

            Console.WriteLine();
        }
    }

    static void AddUser()
    {


        Console.Write("Enter First Name: ");
        string FirstName = Console.ReadLine();
        Console.Write("Enter Middle Initial: ");
        string MiddleInitial = Console.ReadLine();
        Console.Write("Enter Last Name: ");
        string LastName = Console.ReadLine();
        Console.Write("Enter Gender: ");
        string Gender = Console.ReadLine();
        Console.Write("Enter Specialty: ");
        string Specialty = Console.ReadLine();
        Console.Write("Enter Philosophy in Life: ");
        string PhilosophyLife = Console.ReadLine();
        Console.Write("Enter Job Objective: ");
        string JobObjective = Console.ReadLine();

        User newUser = new User {FirstName0 = FirstName,MiddleInitial0 = MiddleInitial,
        LastName0 = LastName,Gender0 = Gender, Specialty0 = Specialty,PhilosophyLife0 = PhilosophyLife,
        JobObjective0 = JobObjective };
        temporaryDatabase.Add(newUser);

        Console.WriteLine("User added to the temporary database.");
    }

    static void ListUsers()
    {
        Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        Console.WriteLine("Applicants:");
        foreach (var user in temporaryDatabase)
        {
            Console.WriteLine($"First Name: {user.FirstName0}\nMiddle Initial: {user.MiddleInitial0}\nLast Name: {user.LastName0}\nGender: {user.Gender0}\nSpecialty: {user.Specialty0}\nPhilosopy in Life: {user.PhilosophyLife0}\nJob Objective: {user.JobObjective0}");
             Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
            
        }
       
    }
    
}