0% found this document useful (0 votes)
7 views4 pages

Assignment 1 - Specification - V1.1

The document outlines an assignment for an advanced programming course at Vietnam National University, Ho Chi Minh City, focusing on implementing classes based on a provided class diagram. It consists of three parts: initial classes in bytecode, fixed classes to be implemented (Knight, Warrior, Paladin, DeathEater), and a free-to-change section. Students must submit their code as a ZIP file with a specified naming format and ensure all classes are in the default package.

Uploaded by

chinh.dang5504
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Assignment 1 - Specification - V1.1

The document outlines an assignment for an advanced programming course at Vietnam National University, Ho Chi Minh City, focusing on implementing classes based on a provided class diagram. It consists of three parts: initial classes in bytecode, fixed classes to be implemented (Knight, Warrior, Paladin, DeathEater), and a free-to-change section. Students must submit their code as a ZIP file with a specified naming format and ensure all classes are in the default package.

Uploaded by

chinh.dang5504
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Vietnam National University, Ho Chi Minh City

Ho Chi Minh City University of Technology


268 Ly Thuong Kiet Street, District 10, Ho Chi Minh City, Viet Nam

Subject: Advanced Programming

Assignment 1
Let the Battle Commence

Requirement

You are given a class diagram as presented in the Appendix. There are three parts.
Part A consists of initial classes, most of which are abstract classes or interfaces.
Initial classes will be given to you as well as bytecode form (class files).
Part B consists fixed classes that you need to implement, which include the
following classes.
- Knight and Warrior: Normally, when battle’s ground is regular number,
the CombatScore of a Knight or Warrior is based on his WP and
baseHP. If WP is 1, the CombatScore is the baseHP. Otherwise, the
CombatScore is baseHP / 10.
o There are 2 special cases of ground number. If ground is a prime
number, the CombatScore of Warriors will be double of their
baseHP. If ground is a square number, the CombatScore of
Knights will be double of their baseHP.
- Paladin: When a Paladin does battle, his CombatScore would be triple
of his baseHP on any ground. Since Paladin is from Heaven, his
CombatScore can exceed 999. Especially, if baseHP of a Paladin is a
Fibonacci number Fn with n > 2, his CombatScore will be 1000 + n.
o For example, if a Paladin has baseHP is 34 (=F9), his
CombatScore will be 1009.
- DeathEater: A Death Eater is a monster, who has no HP but only MP
being a complex number C = (real, imaginary). When combatting,
CombatScore of a Death Eater would be !𝑟𝑒𝑎𝑙 ! + 𝑖𝑚𝑎𝑔𝑖𝑛𝑎𝑟𝑦 !
Part C consists classes which you are free to change.

Note: The game setting (i.e the TeamMaker class) will be changed based
on test-cases. You do not need to implement this class.
Vietnam National University, Ho Chi Minh City
Ho Chi Minh City University of Technology
268 Ly Thuong Kiet Street, District 10, Ho Chi Minh City, Viet Nam

Appendix
Initial Class Diagram

Figure 1. Initial class diagram


Vietnam National University, Ho Chi Minh City
Ho Chi Minh City University of Technology
268 Ly Thuong Kiet Street, District 10, Ho Chi Minh City, Viet Nam

Part A includes following classes in bytecode form.


- The interface Combatable.class
- 3 abstract classes, which are Human.class, Fighter.class,
Monster.class
- Main.class contains the main method.
- Battle.class contains the Battle class which simulates a battle,
calculates the fighting results.

Part B includes classes that you must create by yourself. These classes are fixed as
the diagram in Figure 1.

Part C is the “free-to-change” part as long as there is a Complex class.


Note that both TeamMaker.java and Complex.java are given with dummy
code. You can change the source to adapt the requirement. The TeamMaker.java
will also be replaced when we are grading your work.

Submission

Your initial code is provided as below structure.

/
└── Initial Code
├── class
│ ├── Battle.class
│ ├── Combatable.class
│ ├── Fighter.class
│ ├── Human.class
│ ├── Main.class
│ └── Monster.class
├── source
│ ├── DeathEater.java
│ ├── Knight.java
│ ├── Paladin.java
│ └── Warrior.java
└── util
├── Complex.java
└── TeamMaker.java
└── Utility.java
Vietnam National University, Ho Chi Minh City
Ho Chi Minh City University of Technology
268 Ly Thuong Kiet Street, District 10, Ho Chi Minh City, Viet Nam

You will complete the assignment individually and submit your code as a ZIP file via
LMS. When you submit, rename the folder Initial Code to the following format
YourName_StudentID (e.g., NguyenVanA_1952968)

Note: All classes must be placed in default (root) package.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy