我怎么...在先进的oop做薄 [英] How do I... Do thin in advanced oop

查看:111
本文介绍了我怎么...在先进的oop做薄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。为PetStore系统创建继承层次结构。使用实例petName,petLocation和petPrice以及方法getName(),getLocation(),getPrice()和getSpecData()创建一个Pet类。使用实例dogBreed和方法getSpecData()创建一个类Dog。使用实例catBreed和方法getSpecData()创建一个Cat类。使用实例birdColor和方法getSpecData()创建一个Bird类。类Dog,Cat和Bird继承Pet类。在所有子类中重写Pet类抽象方法getSpecData(),并在所有方法中放置适当的打印消息。创建子类的实例并在main()中调用它们的方法



我尝试过:



我想在代码中回答高级oop帮助我plz

1. Create an inheritance hierarchy for the PetStore system. Create a class Pet with the instances petName, petLocation and petPrice and methods getName(), getLocation(), getPrice() and getSpecData(). Create a class Dog with instance dogBreed and method getSpecData(). Create a class Cat with instance catBreed and method getSpecData(). Create a class Bird with instance birdColor and method getSpecData(). Classes Dog, Cat and Bird inherit the Pet class. Override the Pet class abstract method getSpecData() in all sub classes and put appropriate printing messages in all methods. Create instances of sub classes and call their methods in main()

What I have tried:

I want answer in code fr advanced oop help me plz

推荐答案

引用:

我想在代码fr中回答oop help me plz

I want answer in code fr advanced oop help me plz



No.

我们不做你的作业:它是设置的因为某种原因。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



这不难,只需阅读问题,并重新阅读你的课程笔记。

自己动手,你可能会发现它并不像你想象的那么难!



如果你遇到了一个具体的问题,请询问一下,我们会尽力帮助你。但是我们不打算为你做这一切!


No.
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

This isn't difficult, just read the question, and re-read your course notes.
Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!


除了OriginalGriff的回答......



这是一组MSDN文章,可以帮助您编写正确的代码:

面向对象编程(C#)| Microsoft Docs [ ^ ]

继承(C#编程指南)| Microsoft Docs [ ^ ]

多态性(C#编程指南)| Microsoft Docs [ ^ ]



祝你好运!
In addition to OriginalGriff's answer...

Here is a set of MSDN articles, which may help you to write proper code:
Object-Oriented Programming (C#) | Microsoft Docs[^]
Inheritance (C# Programming Guide) | Microsoft Docs[^]
Polymorphism (C# Programming Guide) | Microsoft Docs[^]

Good luck!


这篇关于我怎么...在先进的oop做薄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆