Question: C# Create a class representing a student. Include properties such as Student Number (string and read-only), First and Last Name (string and read-only), GPA (decimal:

C#

Create a class representing a student. Include properties such as Student Number (string and read-only), First and Last Name (string and read-only), GPA (decimal: get and set), and Major (string: get and set). Write two constructors: the first initializing student number and first and last name while the other initializes all other fields in the same order. Include properties for each of the data items. In the GPA's setter, ensure that the GPA is between 0 and 4; if it's out of range, throw an ArgumentOutOfRangeException.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!