© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
5 replies
SimplyKazuki

✅ Input into list (Console app)

Program

I want the user to keep creating accounts, and then put them inside at list
Example of what the student requires
Student Alex = new Student(1, "Mike", "Scmith", new DateTime(1971, 2, 23), 0);
Student Alex = new Student(1, "Mike", "Scmith", new DateTime(1971, 2, 23), 0);

            Enrollment x = new();
            x.Enrollments = new List<Enrollment>()
            {
            };

            Console.WriteLine("Write students ID:");
            Alex.StudentId = Console.ReadLine();
            Console.WriteLine("Write FirstName");
            Alex.FirstName Console.ReadLine();
            Console.WriteLine("Write LastName");
            Alex.LastName Console.ReadLine();
            Console.WriteLine("Write BirthDate");
            Alex.StudentId Console.ReadLine();
            Enrollment x = new();
            x.Enrollments = new List<Enrollment>()
            {
            };

            Console.WriteLine("Write students ID:");
            Alex.StudentId = Console.ReadLine();
            Console.WriteLine("Write FirstName");
            Alex.FirstName Console.ReadLine();
            Console.WriteLine("Write LastName");
            Alex.LastName Console.ReadLine();
            Console.WriteLine("Write BirthDate");
            Alex.StudentId Console.ReadLine();

Studen Class
    public class Student : PersonalInformation
    {
        public Student(int studentId, string firstName, string lastName, DateTime dateoftime, int age) : base(firstName, lastName, age)
        {
            StudentId = studentId;
        }


        public int StudentId
        {
            get;
            set;
        }
    public class Student : PersonalInformation
    {
        public Student(int studentId, string firstName, string lastName, DateTime dateoftime, int age) : base(firstName, lastName, age)
        {
            StudentId = studentId;
        }


        public int StudentId
        {
            get;
            set;
        }

I am just not sure how to make an entire new object containing the given information, what should I do?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Console input
C#CC# / help
3y ago
Array List & List (Winner list on console)
C#CC# / help
4y ago
Console key input shenanigans
C#CC# / help
4mo ago