0% found this document useful (0 votes)
10 views2 pages

Class Assignment

The document outlines the identification of a student named Michelle, detailing her attributes such as name, registration number, admission date, address, and phone number. It also describes the methods associated with the Student class and provides UML diagrams for the Person class and instances of Animal, Dog, and Cat classes. Each class includes attributes and methods relevant to their respective entities.

Uploaded by

muthoninganga9
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Class Assignment

The document outlines the identification of a student named Michelle, detailing her attributes such as name, registration number, admission date, address, and phone number. It also describes the methods associated with the Student class and provides UML diagrams for the Person class and instances of Animal, Dog, and Cat classes. Each class includes attributes and methods relevant to their respective entities.

Uploaded by

muthoninganga9
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

Identify any object in the real world


Student named Michelle is an object.
2. Identify the attributes and methods of the class
Attributes:-name: Michelle
Reg Number:G10/13913/2022
Date of Admission:22/09/2022
Address:00200
Phone number: 0790259969

Methods: Student()
Student(newname: character)
Student()character
Set Name(newname: character):void
3. Draw the UML diagram for the class

+---------------------+
| Person |
+---------------------+
| - name: String |
| - age: int |
+---------------------+
| + setName(name: String): void |
| + setAge(age: int): void |
| + getName(): String |
| + getAge(): int |
+---------------------+

4. DrawUMLdiagramfor3objects/instances of that class


+---------------------+
| Animal |
+---------------------+
| - name: String |
| - age: int |
+---------------------+
| + setName(name: String): void |
| + setAge(age: int): void |
| + getName(): String |
| + getAge(): int |
+---------------------+

+---------------------+
| Dog |
+---------------------+
| - breed: String |
+---------------------+
| + setBreed(breed: String): void |
| + getBreed(): String |

+---------------------+
| Cat |
+---------------------+
| - color: String |
+---------------------+
| + setColor(color: String): void |
| + getColor(): String |
+---------------------+

You might also like