Assessment item 2JAVA Program using array of objects Due date: ASSESSMENT Weighting: Length: 2…

Assessment item 2JAVA Program using array of objects Due date: ASSESSMENT Weighting: Length: 2 Objectives This assessment item relates to the unit learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop aMenu Driven ConsoleJava Programto demonstrate you can use Java constructs including input/output via GUI dialogs, Java primitive and built-in types, Java defined objects, arrays,
Assessment item 2JAVA Program using array of objects Due date: ASSESSMENT Weighting: Length: 2 Objectives This assessment item relates to the unit learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop aMenu Driven ConsoleJava Programto demonstrate you can use Java constructs including input/output via GUI dialogs, Java primitive and built-in types, Java defined objects, arrays, selection and looping statements and various other Java commands. Your program must produce the correct results. The code for the menu and option selection is supplied:RockyCateringMenu.javaand is available on the unit website, you must write the underlying code to implement the program. The menu selections are linked to appropriate methods in the given code. Please spend a bit of time looking at the given code to familiarise yourself with it and where you have to complete the code. You will need to write comments in the supplied code as well as your own additions. What to submit for this assignment The Java source code: If you submit the source code with an incorrect name you will lose marks. A report including an UML class diagram of your Booking class, how long it took to create the whole program, any problems encountered, and screenshots of the output produced including annotations. (Use Alt-PrtScrn to capture just the application window and you can paste it into your Word document) You should test every possibility in the program. oReportAss2.docx You will submit your files by the due date using the Assignment 2 link on the Moodle course website underAssessment Assignment 2 Submission. Assignment Specification You have completed the console program for processing bookings for Rocky Catering Service. We are going to extend this application so the booking names and number of guests per booking can be stored in an array of objects,do not use ArrayList. The program will run via a menu of options, the fileRockyCateringMenu.javahas been supplied (via the Moodle web site) which supplies the basic functionality of the menu system. Look at the code supplied and trace the execution and you will see the menu is linked to blank methods (stubs) which you will implement the various choices in the menu. Booking class First step is to create a class called Booking ( The Booking class will be very simple it will contain two private instance variables: o bookingName as a String o guests as an integer You should also have constants for the charge and discount values. The following public methods will have to be implemented: o A default constructor o A parameterised constructor o Two set methods (mutators) o Two get methods (accessors) o A method to calculate and return the charge for the booking. This calculation will be the same as in assignment one. Use constants for all numeric literals. Ten to twenty guests will be$29.50 per head. Twenty-one to forty guests will be the cost of twenty guests (at $29.50 per head)$590.00plus$24.50 per headafter that. Over forty guests will be the cost of forty guests$1,080.00plus$19.50 per headafter that. Note: Following basic database principles, calculated values are not usually stored, so in this case we will not store the charge as a instance variable, but use the calculateCharge() method when we want to determine the charge. RockyCaterMenu class Once the Booking class is implemented and fully tested we can now start to implement the functionality of the menu system. Data structures For this assignment we are going to store the booking names and number of guests in an array of Booking objects. Declare an array of Booking objects as an instance variable of RockyCateringMenu class the array should holdtenbookings. You will need another instance variable (integer) to keep track of the number of the bookings being entered and use this for the index into the array of Booking objects. Menu options 1.Enter booking name and number of guests: enterBooking() For assignment two we are going to use the GUI dialog showInputDialog() for our input. You will need to create the following two dialogs to receive the input from the user. You will not implement the functionality of the cancel key (need to use exceptions for this). Use Integer.parseInt() to convert the number as a string into an integer. Data validation (you can implement this after you have got the basic functionality implemented) You will need to validate the user input using avalidation loop. The booking name cannot be blank i.e. not and the number of guests cannot be blank and the number of guests needs to be greater than or equal to ten, the same as assignment one. Output the following error dialogs: When the booking name and number of guests have been entered successfully into two local variables you will need to add these values into the bookings object array, you will also need to increment a counter to keep track of the number of bookings you have entered and the position in the array of the next booking to be entered. When the maximum number of bookings is reached do not attempt to add any more bookings and give the following error message: When the booking details have been successfully entered, display the details of the booking and the charge on the console screen. Note: For the next three options, display all, statistics and search you should ensure at least one booking has been entered and give an appropriate error message if it there are no bookings entered and for the sorting option you must ensure at leasttwobookings have been entered, for example: 2.Display all booking names, number of guests and charges: displayAllBookings() When this option is selected display all of the bookings which have been entered so far. 3.Display statistics: displayStatistics() When this option is selected you will display the statistics as per assignment one. You can loop through your array of objects to calculate this information. 4.Search for a booking: searchBookings() You can just use a simple linear search which will becase insensitive. Use the showInputDialog() method to input the booking name (you can share this functionality from enter booking). If the search is successful display the details about the booking. If the search is unsuccessful display an appropriate message. 5.Sort the bookings: sortBookings() This option you will sort the bookings alphabetically (ignore case) by the booking names, you can use any sorting algorithm which you like,do not use any in-built sort methods. Display the sorted list after the sort is complete. Remember the welcome and exit messages as per assignment one. Extra Hints Your program should be well laid out, commented and uses appropriate and consistent names (camel notation) for all variables, methods and objects. Make sure you have no repeated code (even writing headings in the output) Constants must be used for all numbers (numeric literals) in your code. Look at the marking criteria to ensure you have completed all of the necessary itemsRefer to a Java reference textbook and the unit and lecture material (available on the course web site) for further information about the Java programming topics required to complete this assignment. Check output, check code and add all of your comments, complete report and the UML class diagram. Supplied Code Download, compile and run the supplied code available from the course web site. You will see the menu interface has been implemented and you have to implement the underlying code, use the supplied method stubs and add your own methods. Follow the // TODO comments in the supplied code. Again no code should be repeated in your program. If you just submit the supplied code you will receive zero marks. Good luck! Bruce McKenzie Unit Coordinator T319 COIT20245 XXXXXXXXXX Marking scheme is on the following page. Variables, constants and types Variables have meaningful names and use camel notation Variables are the correct type and constants are used Array of objects is used Code in general Code is indented and aligned correctly Code is easy to read (use of vertical whitespace) Code has header comment which includes name, student ID, date, file name and purpose of the class Code is fully commented including all variables and methods No repeated code Booking class Instance variables are correct and private Default and parameterised constructors are correct Method for calculating charges is correct Get and set methods are correct RockyCateringMenu class — Enter Booking Booking name is read correctly Number of guests is read correctly Data is added to the object array correctly Output resembles the specification (two decimal points) Charges calculated correctly Error dialog when maximum bookings is reached Error dialog when booking name not entered Error dialog when number of guests is blank or is out of range Data validation loops are correct Display all bookings All records displayed Output resembles the specification Display statistics Maximum and minimum are correct Average is correct Total charges is correct Output resembles the specification (two decimal points) Search Search is correct and correct details returned Search is case insensitive not found is correct Sort Sort is correct and inbuilt sorting methods are not used Sort is case insensitive Sorted list is displayed after sort General Welcome and exit message (as per assignment one) No bookings entered is handled correctly Correct files submitted including types and names Report UML class diagram of Booking class is correct Screen shot(s) of testing and annotations Report presentation and comments including how long it took and any problems encountered

View less

Custom Paper Help
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.


Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.


Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.


Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.


Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.