Question: Objective You will do some programming exercises of variables and data types in C#. It will help you to improve your programming skills in using
Objective You will do some programming exercises of variables and data types in C\#. It will help you to improve your programming skills in using struct, array, list, and object(instance) creation using struct in C\#. Q1: Use Visual Studio editor to write a console program in C\# to display complete student information. Create a struct Person with members for the first name, last name and age. Create another struct Student with members: Person, student ID, college name, city, and address. (Check the solution of Lab 3.2) Create two objects for representing two students from the same college, one is hard-codded and the second is entered by the user on run time. Accept (validate) student's and college values into the appropriate struct variable's datatypes (use Convert class). Have the option 1 that allow you to add the student instance in that array. Add the try \& catch to all your conversions from string to some other datatypes (use goto instruction if you have an exception). Store all those values into an object, and then, save it into an array. Create a list of the same type as the array (Student) with those instances of the array. Have the option 2 that allow you to add the student instance into the list. Have the option 3 to print (show) all the student's information from the array. Display student data by using the interpolation (align all the numbers to the right and the text to the left). Have the option 4 to print (show) all the student's information from the list (use foreach loop). Display student data by using the placeholders (align all the numbers to the right and the text to the left)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
