C++作业二狼吃羊

上传者: u010672692 | 上传时间: 2020-01-03 11:36:37 | 文件大小: 38.07MB | 文件类型: 7z
需求 该程序设计的是一个狼吃羊的小故事,大灰狼吃小绵羊 。所有大灰狼和小绵羊都在青青草原中生活。系统首先初始化大灰狼们和小绵羊们的基本信息。经过一段时间的自动运行。查看当前系统的基本情况。 1) 每个大灰狼和小绵羊都具有位置信息,性别、年龄等基本信息。 2) 大灰狼和小绵羊都有一定的生存规则,如运动规则,繁殖规则(年龄、性别),死亡规则(年龄),捕食规则(可以通过位置判定可以捕食,小绵羊可以逃跑)等。 3) 程序初始化时,需要初始化大灰狼和小绵羊的数量,随机生成每个生物的基本信息。并打印输出。 4) 通过键盘输入运行时间。 5) 程序根据运行时间运行,大灰狼和小绵羊按照自己的生存规则运行。 6) 程序需要输出生存期间的重要事件(如捕食、逃脱、繁殖等)。 7) 运行结束,输出当前青青草原中大灰狼和小绵羊的基本信息(数量,基本信息)。 2. 问题分析 本题的设计思路如下,建立生物基类,并派生出大灰狼、小绵羊的子类。根据需要建立类的成员函数和成员方法,其中包括捕食、死亡等多态方法。在main函数中采用数组和new动态生成用户需要生成的狼和羊的数量及基本信息。该题目主要涉及到的知识点有:继承、派生、多态。

文件下载

资源详情

[{"title":"( 76 个子文件 38.07MB ) C++作业二狼吃羊","children":[{"title":"WolfSheepApp","children":[{"title":"WolfSheepApp","children":[{"title":"resource.h <span style='color:#111;'> 1.84KB </span>","children":null,"spread":false},{"title":"Animal.cpp <span style='color:#111;'> 1.44KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.aps <span style='color:#111;'> 106.46KB </span>","children":null,"spread":false},{"title":"stdafx.h <span style='color:#111;'> 1.54KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.h <span style='color:#111;'> 482B </span>","children":null,"spread":false},{"title":"Ecological.cpp <span style='color:#111;'> 2.40KB </span>","children":null,"spread":false},{"title":"targetver.h <span style='color:#111;'> 234B </span>","children":null,"spread":false},{"title":"Tiger.h <span style='color:#111;'> 287B </span>","children":null,"spread":false},{"title":"pic","children":[{"title":"tiger.bmp <span style='color:#111;'> 6.62KB </span>","children":null,"spread":false},{"title":"sheep.png <span style='color:#111;'> 1.25KB </span>","children":null,"spread":false},{"title":"sheep1.bmp <span style='color:#111;'> 5.68KB </span>","children":null,"spread":false},{"title":"C00010.bmp <span style='color:#111;'> 3.24KB </span>","children":null,"spread":false},{"title":"background1.bmp <span style='color:#111;'> 300.43KB </span>","children":null,"spread":false},{"title":"sheep.bmp <span style='color:#111;'> 5.68KB </span>","children":null,"spread":false}],"spread":true},{"title":"Debug","children":[{"title":"link.3480-cvtres.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 6.11KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.log <span style='color:#111;'> 1.81KB </span>","children":null,"spread":false},{"title":"link-mt.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link-mt.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link-cvtres.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 2.05KB </span>","children":null,"spread":false},{"title":"vc110.pdb <span style='color:#111;'> 7.46MB </span>","children":null,"spread":false},{"title":"rc.write.1.tlog <span style='color:#111;'> 226B </span>","children":null,"spread":false},{"title":"Tiger.obj <span style='color:#111;'> 252.61KB </span>","children":null,"spread":false},{"title":"stdafx.obj <span style='color:#111;'> 789.98KB </span>","children":null,"spread":false},{"title":"link.3480-rc.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.3480-rc.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.3480-cvtres.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"CL.write.1.tlog <span style='color:#111;'> 5.95KB </span>","children":null,"spread":false},{"title":"rc.command.1.tlog <span style='color:#111;'> 644B </span>","children":null,"spread":false},{"title":"cl.command.1.tlog <span style='color:#111;'> 4.91KB </span>","children":null,"spread":false},{"title":"WolfSheepAppDlg.obj <span style='color:#111;'> 299.48KB </span>","children":null,"spread":false},{"title":"vc110.idb <span style='color:#111;'> 2.89MB </span>","children":null,"spread":false},{"title":"link-cvtres.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link-rc.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"WolfSheepApp.res <span style='color:#111;'> 68.13KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.pch <span style='color:#111;'> 35.69MB </span>","children":null,"spread":false},{"title":"link.3480.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"rc.read.1.tlog <span style='color:#111;'> 2.69KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.Build.CppClean.log <span style='color:#111;'> 4.72KB </span>","children":null,"spread":false},{"title":"link.3480.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 184.56KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.lastbuildstate <span style='color:#111;'> 59B </span>","children":null,"spread":false},{"title":"Animal.obj <span style='color:#111;'> 252.85KB </span>","children":null,"spread":false},{"title":"link.3480-mt.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"WolfSheepApp.obj <span style='color:#111;'> 278.97KB </span>","children":null,"spread":false},{"title":"Sheep.obj <span style='color:#111;'> 253.00KB </span>","children":null,"spread":false},{"title":"Ecological.obj <span style='color:#111;'> 264.32KB </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 1.13KB </span>","children":null,"spread":false},{"title":"link-rc.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.3480-mt.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false}],"spread":false},{"title":"stdafx.cpp <span style='color:#111;'> 145B </span>","children":null,"spread":false},{"title":"ReadMe.txt <span style='color:#111;'> 3.86KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.cpp <span style='color:#111;'> 2.39KB </span>","children":null,"spread":false},{"title":"Ecological.h <span style='color:#111;'> 304B </span>","children":null,"spread":false},{"title":"WolfSheepApp.vcxproj.filters <span style='color:#111;'> 2.80KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.vcxproj <span style='color:#111;'> 6.38KB </span>","children":null,"spread":false},{"title":"Sheep.cpp <span style='color:#111;'> 1.78KB </span>","children":null,"spread":false},{"title":"WolfSheepAppDlg.h <span style='color:#111;'> 1.61KB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"WolfSheepApp.rc2 <span style='color:#111;'> 680B </span>","children":null,"spread":false},{"title":"WolfSheepApp.ico <span style='color:#111;'> 66.19KB </span>","children":null,"spread":false}],"spread":false},{"title":"WolfSheepApp.rc <span style='color:#111;'> 10.78KB </span>","children":null,"spread":false},{"title":"Sheep.h <span style='color:#111;'> 316B </span>","children":null,"spread":false},{"title":"Tiger.cpp <span style='color:#111;'> 1.43KB </span>","children":null,"spread":false},{"title":"WolfSheepAppDlg.cpp <span style='color:#111;'> 7.72KB </span>","children":null,"spread":false},{"title":"Animal.h <span style='color:#111;'> 491B </span>","children":null,"spread":false}],"spread":false},{"title":"ipch","children":[{"title":"wolfsheepapp-775e726f","children":[{"title":"wolfsheepapp-b63aedba.ipch <span style='color:#111;'> 86.75MB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"WolfSheepApp.sdf <span style='color:#111;'> 91.81MB </span>","children":null,"spread":false},{"title":"WolfSheepApp140423.vsp <span style='color:#111;'> 212.00KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.v12.suo <span style='color:#111;'> 33.50KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"WolfSheepApp.pdb <span style='color:#111;'> 8.47MB </span>","children":null,"spread":false},{"title":"WolfSheepApp.exe <span style='color:#111;'> 221.50KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.ilk <span style='color:#111;'> 3.18MB </span>","children":null,"spread":false}],"spread":true},{"title":"WolfSheepApp.sln <span style='color:#111;'> 998B </span>","children":null,"spread":false},{"title":"WolfSheepApp.psess <span style='color:#111;'> 3.16KB </span>","children":null,"spread":false},{"title":"WolfSheepApp.v11.suo <span style='color:#111;'> 61.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • solo.dream :
    学习学习。
    2019-01-16
  • welkinland :
    缺少文件,运行不了TAT
    2015-01-11

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明