C# - C Sharp: Practical 3: Zoo Management System


Khóa học qua video:
Lập trình Python All Lập trình C# All SQL Server All Lập trình C All Java PHP HTML5-CSS3-JavaScript
Đăng ký Hội viên
Tất cả các video dành cho hội viên

ZOO MANAGEMENT SYSTEM

1. Create class Animal has some properties and methods:

· String Name

· Int Age

· ​String Description

· ​Void ViewInfo() //display Name, Age, and Description of the animal

· Void Speak()

2. Create some constructors for class Animal that we can input n parameter(s) when creating new instance from class:

· 0 parameter

· 1 parameter ( Name),

· 2 parameters ( Name, Age),

· 3 parameters ( Name, Age, Description).

3. Create some classes: Tiger, Dog, Cat following these instructions:

  • Inherit properties and methods from class Animal
  • Override method Speak to demonstrate different sounds of different animals
  • Implement multiple constructors for these classes using constructors inheritance

4. Create class Cage has some properties and methods:

· Int CageNumber

· ​ArrayList AnimalList

· ​Void AddAnimal(Animal a) //add an animal to AnimalList

· ​Void RemoveAnimal(string name) //remove an animal has Name “name” from AnimalList

5. Create class Zoo has some properties and methods:

· ArrayList CageList

· Void AddCage(Cage c) //add a cage to CageList

· Void RemoveCage(int c) //remove a cage has CageNumber c from CageList

6. Create menu for Zoo Management System:

  1. Add Cage
  2. Remove Cage
  3. Add Animal
  4. Remove Animal
  5. Iterate Animals
  6. Exit

7. When user choose Iterate Animal, go to all the cages in Zoo, display information of all animals in cage and display their voice.

» Tiếp: Practical 4: Animal Management System
« Trước: Practical 2: Products Management System
Khóa học qua video:
Lập trình Python All Lập trình C# All SQL Server All Lập trình C All Java PHP HTML5-CSS3-JavaScript
Đăng ký Hội viên
Tất cả các video dành cho hội viên
Copied !!!