Question: make a class library with two classes in it: Student and Mark. The class diagrams are shown below. Make sure that your classes conform to

make a class library with two classes in it: Student and Mark.

The class diagrams are shown below. Make sure that your classes conform to them exactly.

Create Mark class.

make the following class members:

  • grade is a private field representing the grade for a course
  • NumberOfCredits is the public read only field representing weight of the course in credits
  • CourseName is auto implemented property representing the course name
  • Grade is the property that is accessor for grade field. The valid grade is in range 0 to 100. The property will throw an exception in case of invalid value with the message: "Mark with value {value} is not valid" {value} is the value of the invalid grade.
  • A constructor with two parameters: course name and number of credits for the course. It assigns them to appropriate members.
  • ToString() method that generates the string with information about the mark. Make sure that your output matches the one that is provided.

make Student class

make the following class members:

  • Gpa is a private field containing the GPA of a student.
  • GPA is read only property providing the access to the gpa field.
  • Id is auto implemented property representing student id.
  • Name is auto implemented property representing student name.
  • Marks is auto implemented read only property that contains a list of Mark objects.
  • A public parameterless constructor that initialise Marks property.
  • A constructor that takes 2 parameters: student id and the name and assigns their values to appropriates properties.
  • Make sure that there is no code duplication in the constructors.
  • calculateGpa method t calculates the student's GPA based on the current marks and assign it to the appropriate class member. GPA is calculated as the sum of weighted grades divided by sum of credits. The weighted grade is calculated by multiplying a course grade by number of the course credits.
  • AddMark() method has 3 parameters: course name, number of credits and grade. The method will create the Mark object, assigns the grade to the appropriate property, adds it to the list of marks for a student. Mark object is only added to the list of marks if the grade is assigned.
  • This method makes the necessary updates to other members of the student object.

code language is c# plz answer asap

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!