The implementation of a C# program, which focuses on using
classes to generate and manipulate objects, is detailed in this report. Constructors,
methods, and an override ToString function have to be added to a Student class
based on a UML model that was given. As part of the software, it was required to
create objects, set their attributes, compare their GPAs, and show their data.
a) Write a C# code for the following UML class:
(6 marks)
Student
- id : String
- name : String
- GPA : double
+ Student (id)
+ Student (id, name)
+ setName (name: String)
+ setGPA (value: double)
+ getGPA( ): double
+ getName ( ) : String
+ isHigher (av: double) : Boolean
+ ToString ( ): String
b) Write the statement(s) needed for the following questions (total 6 marks):
a) (2 marks) Create two objects named (maleStudent) and (femaleStudent) using different constructors with ant values you select.
b) (0.5 mark) Set any name for the object created by the first constructor.
c) (0.5 mark) Set the GPA of both objects for any values.
d) (1 mark) Call isHigher method and print appropriate message.
e) (0.5 mark) Display the GPA of the femaleStudent.
f) (0.5 mark) Display the name of the maleStudent.
g) ( 1 mark) Display the information (fields) of one of the objects explicitly and the other object implicitly.