Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

=+j Describe an effective crisis management program.

Answered: 1 week ago