Ask a question from expert

Ask now

LAB: Inheritance.

2 Pages447 Words340 Views
   

Added on  2019-09-16

LAB: Inheritance.

   Added on 2019-09-16

BookmarkShareRelated Documents
LAB: InheritancePart A – playing with code.1.Save the CatExampleWithInheritance application available on the course page for this week in a trusted location and study the code. Comment the c#code (all the main lines, especially the ones linked to inheritance)2.Save the InterfaceExample application available on the course page for this week in a trusted location and study the code Comment the c# code (all the main lines, especially the ones linked to inheritance)Part B - Change the CatExampleWithInheritance application that you downloadedEXERCISE 1: change the necessary code in the following way:1.In the Cat class add a method called “HasFlees()” which should return a Boolean. This method should be seen only by the base Cat class and its children. The method should return true value. Change the Talk() method so it would say if the cat has flees.2.In the BreedCat class override the method “HasFlees()” and make it return falseEXERCISE 21.You should have noticed that showing cat images is not implemented in a consistent way. Change the code in such way that every cat has a specific image in the following way:In the class Cat have a field “imageString” of type string.Change the code in such way that Fluffy and Jassie are instantiated with the correct images (use a particular cat image for each) .Change the code in such way that all new cats (moggies) will have a particular image of your choiceChange the code in such way that for the breed cats the user can choose a breed from a drop down list and, according to the selected breed, a specified image is displayedHint: you can store the breeds and the images’ names in arrays, generic lists or a table in the database
LAB: Inheritance._1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Visual Studio Project | Assignment On C# Console Application
|3
|1002
|81

Research on Object Oriented Language
|2
|647
|530

Working with Sessions and Collections in .NET Web Forms Applications
|4
|860
|356

Hints for completing Assignment 1 for an Android application project
|9
|4524
|331

Parallel Distributed Branch and bound solution in rmi PDF
|18
|829
|98

JavaFX Breakout/Arkanoid Game Implementation
|2
|885
|200