0% found this document useful (0 votes)
926 views3 pages

Advanced C# Exercises & Assignments PDF

This document provides instructions for a three-part advanced C# exercise involving object-oriented design. Part 1 asks students to design an "Animal" class to represent different species in the animal kingdom, including defining characteristics and behaviors. It also involves implementing inheritance. Part 2 evaluates the design against object-oriented principles. Part 3 extends the design into a case study simulating disease spread on a virtual chicken farm, requiring classes for diseases, chickens, and tracking farm populations/statistics. Students are to complete code examples and provide diagrams/documentation for their solutions.

Uploaded by

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

Advanced C# Exercises & Assignments PDF

This document provides instructions for a three-part advanced C# exercise involving object-oriented design. Part 1 asks students to design an "Animal" class to represent different species in the animal kingdom, including defining characteristics and behaviors. It also involves implementing inheritance. Part 2 evaluates the design against object-oriented principles. Part 3 extends the design into a case study simulating disease spread on a virtual chicken farm, requiring classes for diseases, chickens, and tracking farm populations/statistics. Students are to complete code examples and provide diagrams/documentation for their solutions.

Uploaded by

muhammadkamran05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Advanced C# Exercise Files

ISN 6155 Advanced C# Exercise File


Part1​​: ​Basics​​ (​Classes/Objects design and implementation​)

Instructions​​:
For activity, you have to produce a detailed class diagram or sequence diagram and collaboration
diagram before explaining the code. These diagrams along with the detailed explanations are part of
the software documentation of your project. All students are requested to post their work in this
shared file. Before posting tag your participation like the instructor. Codes will be explained and
demonstrated live by sharing screens during the class.
Good luck!!!!

<<<<<<<<<<Daniel Moune (Instructor) posted on 04-11-2018>>>>>>>>>>>

Exercise: Defining your own classes


1. You have to design a class named “Animal”. The purpose of that class is to represent the
following animal kingdom tree

a. Analyze the following tree and provide a list of 05 characteristics and 05


behaviours that are common to all the animals of that tree

Daniel Moune (Instructor) | +237675082872 | moune.daniel@ictuniversity.org


1
Advanced C# Exercise Files

b. Define a Class name “Animal” which will completely encapsulate its


characteristics providing no direct access to them but providing accessors to get
or set them. Your class should also provide the expected 05 behaviours you
uncovered in the previous question.
c. Add 02 constructors to your Animal class. The first one would be a default
constructor and the second should be able create an animal based on the name of
its species. The constructors will use enumerations to identify how to set the
appropriate characteristics of the animal before creating it.
d. Finally define an instance ​declare an instance of Animal for each species and for
each animal run 02 of its most recognizable behaviour.

2. Let’s now be more specific. You have been able to define your animal class. But you
now have to analyze your design and check whether your designs satisfy the principles
of Object Oriented engineering or not.
a. Name and describe the principles of Object Oriented engineering
b. Which of these principles has been satisfied in your earlier design. Justify your
answers
c. What do you need to do to satisfy the non-satisfied ones?
d. Let’s try to put in place inheritance in your design.
i. Name the advantages of inheritance in Object Oriented design
ii. What should be the nature of your “Animal” class to efficiently
maximize extensibility of properties and behaviours in its subclasses?
iii. Implement your current design in C#

3. Let’s extend your design to a case study. You are requested to use your design to
produce a virtual environment that will simulate a farm on your PC. The purpose of
such an environment is to study the spread of some diseases in a farming
environment. Let’s start your virtual farm with chickens. The disease to simulate is
the “Newcastle disease”
a. Look for facts about the NewCastle disease on internet and produce a short
summary about its symptoms, infection and transmission mode, incubation
period, direct and future consequences on a particular animal in the population

Daniel Moune (Instructor) | +237675082872 | moune.daniel@ictuniversity.org


2
Advanced C# Exercise Files

b. Provide an Object Oriented design of the “Disease” Class. Provide also a


design for the chicken class in order to simulate a chickens in your actual
population. Your “Chicken” class should be able to count the number of
individuals that has been instantiated through direct instantiation or through
reproduction. The class should also reproduce behaviours of healthy, ill and
recovery health status.
c. Design a “Poultry” class to compute statistics about your chickens’
population. We should be able to get stats about the total population (age
repartition, sex repartition, healthy, ill, recovering, dead, etc..).
d. Provide a C# implementation of your classes

Daniel Moune (Instructor) | +237675082872 | moune.daniel@ictuniversity.org


3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy