文件名称:Monster
-
所属分类:
- 标签属性:
- 上传时间:2013-05-16
-
文件大小:1.56kb
-
已下载:5次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
一个初级JAVA程序小游戏,不同的怪兽会有不同的攻击方式,满100伤害停止。-
1. The sub-questions below concern a Java application that deals with monsters.
i) Create a class called Monster (to be stored in file Monster.java), such that:
Every monster has a name and,
Every monster can attack and move (i.e. the class Monster has two methods, attack()
and move()).
A generic monster attack() method should return a random integer value between 1 and 5. It
should also print the following message to the console:
“NAME, of type CLASS_TYPE, attacks generically: X points damage caused.”
where:
NAME = monster name
CLASS_TYPE = class of monster1
X = random integer in the specified range
The monsters’ generic move() method should be defined as follows:
public void move(int directio
1. The sub-questions below concern a Java application that deals with monsters.
i) Create a class called Monster (to be stored in file Monster.java), such that:
Every monster has a name and,
Every monster can attack and move (i.e. the class Monster has two methods, attack()
and move()).
A generic monster attack() method should return a random integer value between 1 and 5. It
should also print the following message to the console:
“NAME, of type CLASS_TYPE, attacks generically: X points damage caused.”
where:
NAME = monster name
CLASS_TYPE = class of monster1
X = random integer in the specified range
The monsters’ generic move() method should be defined as follows:
public void move(int directio
(系统自动生成,下载前可以参看下载内容)
下载文件列表
1/Dragon.java
1/Monster.java
1/MonsterMash.java
1/Troll.java
1
1/Monster.java
1/MonsterMash.java
1/Troll.java
1
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.