RMIT 皇家墨尔本理工大学
COSC1295 Advanced Programming
Introduction
You are required to implement a basic Java program using Java. This assignment is designed to:
• Test your knowledge of basic Java concepts.
• Evaluate your ability to design programming logic.
• Practice simple object design in Java.
This is an individual assignment. Your final submission is worth 15%; a simple demo in Week 4 is worth a
further 3%, giving a total of 18% for Assignment 1.
Academic Integrity (more)
The submitted assignment must be your own work. No marks will be awarded for any work which is
not created by you.
Plagiarism is treated very seriously at RMIT. Plagiarism includes copying code directly from other students
(or enables such copying), the internet, the output of AI systems, or other resources without
proper reference. Sometimes, students’ study and work on assignments together and submit similar files
which may be regarded as plagiarism. Please note that y o u should always create your own assignment
even if you have very similar ideas. Plagiarism-detection tools will be used to check all submissions.
Penalties may be applied in cases of plagiarism.
The Reading Room Book Shop
You are to implement a book purchasing system, called “The Reading Room”. The system keeps a list of
books that can be purchased (in physical and/or ebook form) as follows.
• Each book has limited number of physical copies. You will track the number of available physical
copies of each book. If the user tries to buy a (physical) book and there are no copies available,
then the system outputs an error message.
• Some (not all) books are available in ebook form. There is no limit of copies for ebooks. If the ebook
exists for a book, then there is always a copy of the ebook available.
• All physical books cost $50.00; all ebooks cost $8.00.
• The user can request purchasing a book by specifying a keyword: the system lists all books that
contain the keyword, along with the number of copies and ebook availability. The user chooses
which form of the book they want: if the book is available then it gets added to the user’s “shopping
cart”. Note that keyword matching is not case-sensitive here.
• The user can view and update the shopping cart.
• The user can print the full list of books and their availability.
• Once the user is finished selecting books, the user can “checkout and pay”; the system prints the
final total price and updates the number of copies of each book.
• The user can quit the system (before or after paying).
Assumptions and Simplifications.
1. All prices as per Australian currency denominations.
2. Correct input can be assumed in this assignment. Error handling is not required.
Part A
Implement the above specifications without necessarily using object-oriented design at this stage. The key
focus is to implement the correct algorithm logic. You can implement the system in one main program in
a single class (Note: you may skip Part A and go straight to Part B with the use of OO. Part A is designed
to let you focus on the basic functionalities.)
Following is a possible sample interaction with the bookstore system. You do not have to strictly follow
the format but it illustrates required functionality. Text in bold and green is input from the user:
Part B
The aim of Part B is to incorporate basic object-oriented concepts into your program and test main
functionality. In particular, define a Book class that contains all information related to a book title, including
the title, author (this is new!), number of physical copies, and ebook availability. Using the OO solution,
you should only use ONE ARRAY---an array of Book objects.
The only change to the functionality is that when you print list of books, you list both title and author, as
well as number of copies and ebook availability (see example output below).
NOTE1: it is OK to start using Object Oriented concepts from the start of the assignment if you prefer---
i.e. it is not a requirement to complete Part A before introducing OO.
咨询 Alpha 小助手,获取更多课业帮助