OOP 代写|Java 代写


RMIT 皇家墨尔本理工大学

COSC1295 Advanced Programming

Background Story

You are programming a robot that helps hospital staff in carrying out some oftheir duties. The robot is required to visit the patient rooms and check whetherthe patient is present. If that is the case, the robot must ask the patient if theyhave taken their assigned medication. At the end of the visits, the robot reportsto the doctor which patients were not in the room, and which did not take theirmedication.Important NoteEvery implementation point described below is associated a number of marks. Inprevious years, we noticed that students frequently try to farm partial marks by writingsome amount of code for every section, even though none of it can even be executed.This is not the way to develop any complex system, and we intend to disincentivise it.For the reason described above, if a node implementing a piece of functionality doesnot execute, at most half the marks for that ROS node can be awarded. Marks arerounded up. Therefore, if an item is worth 5 marks, the most that a non-executablecode can get is 3.By non-executable, we mean that the code immediately terminates with an error dueto syntactic issues in the file, or wrong import statements. Runtime exceptions or bugsthat do not happen in the early stages of the execution will not be considered as non-executable, and therefore will not incur the penalty.Initialization• Create a package called "resit_coursework". Remember to maintain thecorrect dependencies in package.xml and CMakeLists.txt during development




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 小助手,获取更多课业帮助