代写INFO1113 Assignment - Hogwarts Archive代写Java程序

INFO1113

Assignment - Hogwarts Archive

Due: 24 October 2025, 23:59 AEST

This assignment is worth 20% of your final assessment

Task Description

You have been appointed Keeper of the Hogwarts Archive, entrusted with the vital task of maintaining the records of every student and spellbook in the school. Your Java program must manage student accounts, track spellbook rentals, and preserve detailed histories, ensuring that no tome is lost or misused. You will catalogue spellbooks individually or as collections, and implement commands to list, rent, return, and save them. Accuracy and efficiency are paramount, as the very knowledge of Hogwarts depends on the integrity of your archive.

You are encouraged to ask questions on Ed under the assignments category if you are unsure of the specification - but staff members will not be able to do any coding or debugging in this assignment for you. As with any assignment, make sure that your work is your own, and do not share your code or solutions with other students.

Working on your assignment

You can work on this assignment on your own computer or the lab machines. It is important that you continually back up your assignment files onto your own machine, external drives, and in the cloud.

You are encouraged to submit your assignment on Ed while you are in the process of completing it. By submitting you will obtain some feedback on your progress on the sample test cases provided.

Implementation details

Write a program in Java that implements the Hogwarts Archive application. You can assume that our test cases will contain only valid input commands and not cause any integer overflows. All commands are case insensitive.

Hogwarts Archive stores collections of Student accounts and Spellbook objects. Student accounts are identified by their student number, and store their name, the spellbooks they are currently renting, and their rental history. Student numbers start at 100000 and increment up (such that the second Student account will have student number 100001). Multiple students may have the same name, but they must be assigned different student numbers.

A Spellbook is identified by its serial number, and store the title, inventor, type, student currently renting, and rental history. Students are able to rent and return spellbooks, with only one student able to rent a spellbook at any time. Spellbooks are considered copies of each other if they have the same title and inventor (note that copies of a spell all have different serial numbers).

Spellbook collections can be read from and archived in a CSV (comma-separate values) file, stored in order of serial number in the following form.

Example: 111111,Advanced Potion Making,Libatius Borage,Curse

A spellbook.csv template containing this example has been provided in Resources. You may wish to add further entries yourself to test your program.

Spellbooks can be added to Hogwarts Archive, either individually or as a whole collection. If any serial numbers are already present in the system, those spellbooks should not be added.

Your program will read from standard input and write to standard output. Your program output must match the exact output format shown in the examples and on Ed, including all whitespace and formatting. You are encouraged to submit your assignment while you are working on it, so you can obtain some feedback.

We have provided a scaffold for the HogwartsArchive class, however outside of this you must design and implement your own classes to achieve the required functionality.

In order to obtain full marks, your program will be checked against automatic test cases, manually inspected by your tutors and you must submit a set of test cases that ensure you have implemented functionality correctly.

Commands

Your program should implement the following commands, look at the examples to see how they work. Commands with [LONG] contain optional items that modify the functionality. ... represents a variable number of items.

Additional notes:

HISTORY commands output the result in chronological order (i.e. order of rental).

Rental history is only logged after the spellbook is returned, i.e. spellbooks are only   included in the student’s history once they have been returned and spellbook history only includes past students who have already returned the spellbook.

INVENTOR, TYPE, and COMMON commands output the result in alphabetical order.

•   The program should ignore any invalid commands (e.g. TESTINPUT 10000), but should respond to valid edge cases (e.g. queries before there are any registered books or students). Please see the examples below for the expected output in these cases.

Examples

The examples below show the expected behaviour of the commands.

Example 1

user: LIST ALL

No spellbooks in system.

user: LIST TYPES

No spellbooks in system.

user: LIST INVENTORS

No spellbooks in system.

user: STUDENT 100000 No students in system.

user: RENT 100000 111111 No students in system.

user: RELINQUISH 100000 111111 No students in system.

user: RELINQUISH ALL 100000 No students in system.

user: LIST ALL LONG

No spellbooks in system.

user: EXIT

Ending Archive process.

Example 2

user: ADD STUDENT Harry Potter Success.

user: ADD SPELLBOOK spellbooks.csv 111111

Successfully added: The Standard Book of Spells Grade 1 (Miranda Goshawk)

user: ADD COLLECTION spellbooks.csv

16 spellbooks successfully added.

user: RENT 100000 111111 Success.

user: RELINQUISH 100000 111111 Success.

user: LIST ALL

The Standard Book of Spells Grade 1 (Miranda Goshawk)

The Standard Book of Spells Grade 2 (Miranda Goshawk)

The Standard Book of Spells Grade 3 (Miranda Goshawk)

The Standard Book of Spells Grade 4 (Miranda Goshawk)

The Standard Book of Spells Grade 5 (Miranda Goshawk)

The Standard Book of Spells Grade 6 (Miranda Goshawk)

The Standard Book of Spells Grade 7 (Miranda Goshawk) Dark Charms and their Defense (Quentin Trimble)

Curses and Counter-Curses (Vindictus Viridian)

The Healer’s Handbook (Hippocrates Smethwyck)

The Dragonkeeper’s Guide (Harvey Ridgebit)

The Marauder’s Manual of Mischief (Gellert Grindelwald)

The Jokester’s Treasury of Jinxes (Zacharias Mumps)

A Beginner’s Guide to Transfiguration (Emeric Switch) Intermediate Transfiguration (Emeric Switch)

Advanced Transfiguration (Emeric Switch)

Practical Guide to Unbinding Viridian’s Curses (Eldritch Diggory)

user: SPELLBOOK HISTORY 111112 No rental history.

user: EXIT

Ending Archive process.

Example 3

user: ADD STUDENT Hermione Granger Success.

user: STUDENT 100000

100000: Hermione Granger

user: STUDENT 20000

No such student in system.

user: STUDENT SPELLBOOKS 100000 Student not currently renting.

user: STUDENT HISTORY 100000 No rental history for student.

user: RENT 100000 111111

user: No spellbooks in system.

user: ADD SPELLBOOK spellbooks.csv 111111

Successfully added: The Standard Book of Spells Grade 1 (Miranda Goshawk) .

user: RENT 100000 111111 Success.

user: STUDENT SPELLBOOKS 100000

The Standard Book of Spells Grade 1 (Miranda Goshawk)

user: RELINQUISH 100000 111111 Success.

user: STUDENT SPELLBOOKS 100000 Student not currently renting.

user: STUDENT HISTORY 100000

The Standard Book of Spells Grade 1 (Miranda Goshawk)

user: EXIT

Ending Hogwarts process.

Example 4

user: ADD STUDENT Ron Weasley Success.

user: ADD STUDENT Draco Malfoy Success.

user: ADD COLLECTION spellbooks.csv

17 spellbooks successfully added.

user: RENT 100000 111111 Success.

user: RENT 100000 111112 Success.

user: RENT 100000 111113 Success.

user: RENT 100001 111111

Spellbook is currently unavailable.

user: RELINQUISH ALL 100000 Success.

user: RENT 100001 111112 Success.

user: RENT 100001 111113 Success.

user: RELINQUISH ALL 100001 Success.

user: COMMON 100000 100001

The Standard Book of Spells Grade 2 (Miranda Goshawk)

The Standard Book of Spells Grade 3 (Miranda Goshawk)

user: EXIT

Ending Hogwarts process.

Example 5

user: ADD STUDENT Neville Longbottom Success.

user: ADD STUDENT Lavender Brown Success.

user: ADD STUDENT Pansy Parkinson Success.

user: ADD SPELLBOOK spellbooks.csv 111111

Successfully added: The Standard Book of Spells Grade 1 (Miranda Goshawk).

user: SPELLBOOK 111111

The Standard Book of Spells Grade 1 (Miranda Goshawk)

user: SPELLBOOK 111111 LONG

111111: The Standard Book of Spells Grade 1 (Miranda Goshawk, Charm) Currently available.

user: RENT 100000 111111 Success.

user: SPELLBOOK 111111 LONG

111111: The Standard Book of Spells Grade 1 (Miranda Goshawk, Charm)

Rented by: 100000.

user: RELINQUISH 100000 111111 Success.

user: RENT 100001 111111 Success.

user: RELINQUISH ALL 100001 Success.

user: RENT 100002 111111 Success.

user: SPELLBOOK HISTORY 111111 100000

100001

user: EXIT

Ending Archive process.

Example 6

user: ADD COLLECTION spellbooks.csv

17 spellbooks successfully added.

user: LIST TYPES Charm

Counter-spell Curse

Healing Hex

Jinx

Transfiguration

user: LIST INVENTORS Eldritch Diggory

Emeric Switch

Gellert Grindelwald

Harvey Ridgebit

Hippocrates Smethwyck Miranda Goshawk

Quentin Trimble Vindictus Viridian Zacharias Mumps

user: TYPE Charm

The Standard Book of Spells Grade 1 (Miranda Goshawk)

The Standard Book of Spells Grade 2 (Miranda Goshawk)

The Standard Book of Spells Grade 3 (Miranda Goshawk)

The Standard Book of Spells Grade 4 (Miranda Goshawk)

The Standard Book of Spells Grade 5 (Miranda Goshawk)

The Standard Book of Spells Grade 6 (Miranda Goshawk)

The Standard Book of Spells Grade 7 (Miranda Goshawk)

user: INVENTOR Quentin Trimble

Dark Charms and their Defense (Quentin Trimble)

user: EXIT

Ending Archive process.

Example 7

user: COMMANDS

EXIT ends the archive process

COMMANDS outputs this help string

LIST ALL [LONG] outputs either the short or long string for all spellbooks

LIST AVAILABLE [LONG] outputs either the short of long string for all available spellbooks NUMBER COPIES outputs the number of copies of each spellbook

LIST TYPES outputs the name of every type in the system

LIST INVENTORS outputs the name of every inventor in the system

TYPE outputs the short string of every spellbook with the specified type

INVENTOR outputs the short string of every spellbook by the specified inventor

SPELLBOOK  [LONG] outputs either the short or long string for the specified

spellbook

SPELLBOOK HISTORY outputs the rental history of the specified spellbook

STUDENT outputs the information of the specified student

STUDENT SPELLBOOKS outputs the spellbooks currently rented by the specified student

STUDENT HISTORY outputs the rental history of the specified student

RENT  loans out the specified spellbook to the given student RELINQUISH  returns the specified spellbook from the

student

RELINQUISH ALL  returns all spellbooks rented by the specified student

ADD STUDENT adds a student to the system

ADD SPELLBOOK adds a spellbook to the system

ADD COLLECTION adds a collection of spellbooks to the system SAVE COLLECTION saves the system to a csv file

COMMON  ... outputs the common spellbooks in students' history

user: EXIT

Ending Archive process.

Example 8

user: ADD STUDENT Harry Potter Success.

user: ADD STUDENT Hermione Granger Success.

user: ADD COLLECTION spellbooks.csv

17 spellbooks successfully added.

user: COMMON 100000 100000 Duplicate students provided.

user: COMMON 100000 100001 No common spellbooks.

user: RENT 100000 111112 Success.

user: RENT 100000 111111 Success.

user: RELINQUISH ALL 100000 Success.

user: RENT 100001 111112 Success.

user: RENT 100001 111111 Success.

user: RELINQUISH ALL 100001 Success.

user: COMMON 100000 100001

The Standard Book of Spells Grade 1 (Miranda Goshawk)

The Standard Book of Spells Grade 2 (Miranda Goshawk)

user: STUDENT HISTORY 100001

The Standard Book of Spells Grade 2 (Miranda Goshawk)

The Standard Book of Spells Grade 1 (Miranda Goshawk)

user: EXIT

Ending Archive process.

Example 9

user: ADD SPELLBOOK spellbooks.csv 111111

Successfully added: The Standard Book of Spells Grade 1 (Miranda Goshawk).

user: ADD SPELLBOOK spellbooks_2.csv 111112

Successfully added: The Standard Book of Spells Grade 1 (Miranda Goshawk).

user: ADD SPELLBOOK spellbooks.csv 111113

Successfully added: The Standard Book of Spells Grade 2 (Miranda Goshawk).

user: NUMBER COPIES

The Standard Book of Spells Grade 1 (Miranda Goshawk): 2

The Standard Book of Spells Grade 3 (Miranda Goshawk): 1

user: ADD SPELLBOOK spellbooks.csv 111114

Successfully added: The Standard Book of Spells Grade 3 (Miranda Goshawk).

user: ADD SPELLBOOK spellbooks_2.csv 111115

Successfully added: The Standard Book of Spells Grade 3 (Miranda Goshawk).

user: NUMBER COPIES

The Standard Book of Spells Grade 1 (Miranda Goshawk): 2

The Standard Book of Spells Grade 2 (Miranda Goshawk): 1

The Standard Book of Spells Grade 3 (Miranda Goshawk): 2

user: EXIT

Ending Archive process.

Example 10

user: ADD STUDENT Harry Potter Success.

user: ADD STUDENT Hermione Granger Success.

user: COMMON 100000 100001 No spellbooks in system.

user: ADD SPELLBOOK collections/spellbooks.csv 111111

Successfully added: The Standard Book of Spells Grade 1 (Miranda Goshawk).

user: RELINQUISH 100000 111111 Unable to return spellbook.

user: COMMON 100000 invalid No such student in system.

user: RENT 100000 111111 Success.

user: LIST AVAILABLE

No spellbooks available.

user: EXIT

Ending Archive process.

Marking Criteria (20%)

Your mark consists of four components: your assignment code (submitted via Ed), your test cases (submitted via Ed together with the code), your demo (conducted during week 12), and  your report / UML (submitted via Canvas). Marking will include both automatic marking via test cases and manual inspection by tutors.

Functionality (10%)

You must submit your code and tests using the assignment page on Ed.To submit, simply place your files and folders into the workspace, click run to check your program works and then click submit. You are encouraged to submit multiple times, but only your last submission will be considered.

Marks are assigned based on automatic tests for the correctness of your program. You will only be given valid inputs as part of the test suite. Your program will be checked for errors that a user can possibly make and must match the exact output in the examples and test cases on Ed. In addition to the visible test cases, we will mark your program against a substantial collection of hidden test cases that cover every aspect of the specification.

Test cases (3%)

We have provided you with some test cases but these do not test all the functionality described in the assignment. It is important that you thoroughly test your code by writing your own test   cases. You should place all of your test cases in a tests/ directory, and these will be submitted alongside your codebase on Ed.

Tests will be manually assessed by your tutors. You need to write at least 2 test cases per command (except for EXIT and COMMANDS, which only require 1 test case each). Each test  case should meaningfully check a different aspect of that command’s functionality. Ensure that each test case has a .in input file along with a corresponding .out output file. We require that the names of your test cases are descriptive so that you know what each is testing, prefixed by the name of the command e.g. student_account_numbering.in & student_account_numbering.out and we can accurately and quickly assess your test cases.

Note: If you do not format your test case files as explained (where each test case has .in and .out files for input and output), you shall receive 0 for this component.

Demo / Viva (4%)

The demonstration is conducted during tutorials in week 12, where you will be asked to show the functionality to your tutor and they will ask you questions about your codebase and how you implemented the functionality.

Design, Report, and UML (3%)

You will need to submit a report that elaborates on your design through Canvas. This will include an explanation of any object-oriented design decisions made (such as reasons for class structure, interactions between classes, inheritance etc.). This should be no longer than 500 words.

You will need to submit a UML diagram in PDF form. through Canvas. This will provide a brief graphical overview of your code design and use of Object Oriented Principles such as encapsulation, inheritance, etc.. Markers will use this to determine whether you have appropriately used those principles to aid you in your design, as well as figure out whether more should have been done. A general guideline is that markers will be looking for is clean class structure, separation of concerns, how extensible the code is, and penalising repeated code.

IDE-generated UMLs, ASCII diagrams, and hand-drawings are not acceptable and will receive 0 marks. We suggest using an online diagramming tool such as draw.io or LucidChart.

Your code submission will be inspected manually to check whether it is clear, well documented and concise. Try to utilise OOP constructs within your application and limit repetitive code. The code should follow the conventions set out by the Google Java Style Guide.

Report, UML and OO design: 2%

Code style. and readability: 1%

Learning outcomes

This assignment covers the following Learning outcomes of this UoS:

LO1. Demonstrate an understanding of the concept of Object-Orientation: understand and explain key concepts of object-oriented programming, including classes as encapsulating data, object instances, memory model of references, methods and calling them across objects.

LO2. Demonstrate an understanding of Object-Oriented programming language: reading, tracing and writing competence with the following elements of Java programming language: classes, methods, object creation; instance and local variables, parameters and scope; basic types; simple I/O; control flow primitives and understand, modify and add functionality to Java programs

LO3. Read and interpret object-oriented design documents, including basic UML diagrams.

LO4. Create appropriate class/data structure including the data types and methods for simple problems.

LO5. Derive a computer program from a design document that uses concepts of OO and memory model, trace and write small examples of code including the following elements: inheritance, polymorphism, abstract classes and interfaces, variables and their type and the relationship between static and dynamic type, exception

LO6. Demonstrate experience in testing Object-Oriented programs, write tests for standalone objects, be able to generate and handle exceptions, create invariants for classes, methods and objects, pre- and post-conditions for methods, and assertions

LO7. Demonstrate experience in testing and debugging Object-Oriented programs, write tests for stand-alone object code, to be run automatically.

LO8. Demonstrate experience with common interfaces and collections in Java.




热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图