CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 Windows编程 C#编程

文件名称:Weapon

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2012-11-16
  • 文件大小:
    32.4kb
  • 已下载:
    0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
    别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容来自于网络,使用问题请自行百度

1)、定义一个抽象类Weapon,该抽象类有两个抽象方法attack(),move():这两个方法分别表示武器的攻击方式和移动方式。

(2)、定义3个类:Tank,Flighter,WarShip都继承自Weapon,分别用不同的方式实现Weapon

类中的抽象方法。

(3)、写一个类Army,代表一支军队,这个类有一个属性是Weapon数组w(用来存储该军队所拥有的所有武器);该类还提供一个构造方法,在构造方法里通过传一个int类型的参数来限定该类所能拥有的最大武器数量,并用这一大小来初始化数组w。该类还提供一个方法addWeapon(Weapon wa),表示把参数wa所代表的武器加入到数组w中。在这个类中还定义两个方法attackAll()和moveAll(),让w数组中的所有武器攻击和移动。

(4)、写一个主方法去测试以上程序。

-1), defines an abstract class Weapon, the abstract class has two abstract methods attack (), move (): These two methods represent the weapons attacks and moves.

(2), defines three classes: Tank, Flighter, WarShip are inherited from the Weapon, respectively, in different ways to achieve Weapon

   Class abstract methods.

(3), write a class Army, on behalf of an army, this class has a property is an array of Weapon w (used to store all of the weapons owned by the armed forces) class provides a constructor in the constructor through the mass a parameter of type int to limit the class can have the maximum number of weapons, and to initialize the array with the size of the w. The class also provides a method addWeapon (Weapon wa), that represent the parameters wa added to the array w of weapons. In this class also defines two methods attackAll () and moveAll (), let w array and move all the weapons to attack.

(4), write a main method to test the above procedure.


(系统自动生成,下载前可以参看下载内容)

下载文件列表

抽象类Weapon/
抽象类Weapon/_4/
抽象类Weapon/_4.sln
抽象类Weapon/_4.suo
抽象类Weapon/_4/Army.cs
抽象类Weapon/_4/bin/
抽象类Weapon/_4/bin/Debug/
抽象类Weapon/_4/bin/Debug/_4.exe
抽象类Weapon/_4/bin/Debug/_4.pdb
抽象类Weapon/_4/bin/Debug/_4.vshost.exe
抽象类Weapon/_4/bin/Debug/_4.vshost.exe.manifest
抽象类Weapon/_4/ClassDiagram1.cd
抽象类Weapon/_4/ClassDiagram2.cd
抽象类Weapon/_4/Flighter.cs
抽象类Weapon/_4/obj/
抽象类Weapon/_4/obj/Debug/
抽象类Weapon/_4/obj/Debug/Refactor/
抽象类Weapon/_4/obj/Debug/TempPE/
抽象类Weapon/_4/obj/Debug/_4.csproj.FileListAbsolute.txt
抽象类Weapon/_4/obj/Debug/_4.exe
抽象类Weapon/_4/obj/Debug/_4.pdb
抽象类Weapon/_4/Program.cs
抽象类Weapon/_4/Properties/
抽象类Weapon/_4/Properties/AssemblyInfo.cs
抽象类Weapon/_4/Tank.cs
抽象类Weapon/_4/WarShip.cs
抽象类Weapon/_4/Weapon.cs
抽象类Weapon/_4/_4.csproj

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com