In: Computer Science
Description
In C#
Further enhance the registration program for Continental University.
Existing Code:
class Program { static void Main() { Student s = new Student(); Console.WriteLine("Welcome to the Continental University Registration System!"); Console.WriteLine("Enter data about a student"); Console.Write("First Name: "); string firstName=Console.ReadLine(); Console.Write("Last Name: "); string lastName=Console.ReadLine(); Console.Write("Credits Taking: "); int credits=Convert.ToInt32(Console.ReadLine()); s.firstName=firstName; s.lastName=lastName; s.credits=credits; Console.WriteLine(s); } }
class Student { public string firstName; public string lastName; public int credits; public override string ToString(){ return lastName+", "+firstName+" Credits Taking: "+credits; } }
Sample Dialog
Welcome to the Continental University Registration System!
Enter data about a student
First Name: Mary
Last Name: Smith
Gender (M/F): f
Residency (I/O): i
Credits Taking: 18
Entrance Date: 12/13/2018
Mr. Smith, Mary Credits Taking: 18 Entrance: 12/13/2018 In-state
Do you want to quit (Y/N)?: n
Enter data about a student
First Name: LERNIE
Last Name: BLAKE
Gender (M/F): X
Gender (M/F): M
Residency (I/O): X
Residency (I/O): O
Credits Taking: 12
Entrance Date: 10/01/2018
Mr. Blake, Lernie Credits Taking: 12 Entrance: 10/01/2018 Out-state
Do you want to quit (Y/N)?: Y
Thank you for using the Registration System!