159.234编程 写作、 辅导programming程序

” 159.234编程 写作、 辅导programming程序159.234-2021 Semester 11Assignment 2Deadline: Thursday 6 May, 11 PMEvaluation: 40 marks which represents 20% of your final gradeLate Submission: 5 marks off per day lateTeams: The assignment can be Done individually or in teams of two people (oneassignment per Team submitted including both student names in the source code).Purpose: Practice programming with OOP core concepts using Java1. Problem to solve:You are asked to write a program to be used by Massey University Library. There are three types of items thatcan be borrowed from the library Books, Journals and Movies. The library keeps records of each itemstype, id, title, year, Average rating, number of Reviews, and max number of days for borrowing (28 daysfor books, 14 days for journals, and 7 days for movies). If an item is on loan, its due date should also berecorded. Other information You should record: author and number of pages for books, director for movies,and volume and number for journals.2. Tasks: Your program shouldA. Read text file library.txt; for each line in the file create a Movie/Book/Journal object and add theobject to the library object.B. Output all items in the libraryC. Prompt questions to allow users to do the following (see attached output for more details):a. Search items by id or phrase in title, and list the items foundb. Select an item from the listed items of a search result and display its detailsc. Borrow the Selected item if it is available, and display new due date, ord. Return the selected item if it is on loan, ore. Rate the selected item, and display new average ratingFunctions workflow (related tasks are marked as A, B, C-a, C-b, C-d, C-d, and C-e):Run your programCreate and add library items to your system (A) and output all the items (B)quit or search by id or phrase in title (C-a)quitenter idDisplay selected item details (C-b)borrow or rate the item (C-c, C-e)return or rate the item (C-d, C-e)if item is available if item is on loanDisplay item details after borrowed or rated(C-c, C-e)borrow rate, enter rate valueDisplay item details after returned or rated(C-d, C-e)return rate, enter rate valuerestart restartrestart restartDisplay the matching item(C-a)Selected the itemtitleenter phrase in titleDisplay all the matching items(C-a)Selected one of the Displayed itemstitlerestartrestartRestartsearch bytitleRestartsearchby id159.234-2021 Semester 123. Design and Implementation GuidelineNote: The following OOP and general software design concepts will be checked while marking the program1) Class design and implementationb. data fields internal data not accessed by external classesc. methodsd. constructors2) Encapsulation design and implementation proper use of modifiersa. privateb. protectedc. public3) Inheritance design and implementationa. Reasonable class hierarchiesb. Proper data fields separation in base and derived classesc. Proper methods separation/overloading/overriding in bass and derived classesd. Proper use of base and derived class constructors4) Polymorphism and implementationa. Write generic code that targets the base class whenever possibleb. Appropriate use of overriding in derived classes to realize polymorphism5) Information store and implementationa. Use ArrayList or other Java collection class to store information.b. Must make use of Getters and/or setters wherever appropriate.6) Exception handlinga. Throw an exception object when an application error occurs (For example, an invalid piece of data isentered)b. Using try/catch/finally or try/catch block to handle the exception3159.234-2021 Semester 14. You must follow the next three specifications in each and every assignment for this course1) Place the following comments at the top of your program code and provide the appropriateinformation:// Family Name, Given Name, Student ID, Assignment number, 159.234/* explain what the program is doing . . . */2) Create the function displayInfo and provide the appropriate information as shown below:The displayInfo should be the first thing that you display on the screen.3) DO NOT use any function to clean the screen at any stage of a program, for any assignment in thiscourse.5. Hand-in: Submit all your .java file as a2.zip electronically on the course stream site.Marks will be allocated for: correctness, completeness, no code duplication, applying OOP core concepts appropriately,documentation, clear on screen output display6. Output of a sample solutionTask A: Add the test data (see library.txt file) into your system.This is the content of the provided library.txt for test purpose.Record of movie:Type, Id, title,year, directorRecord of book: Type,Id, title, year, author,number of pagesRecord of journal:Type, Id, title, year,volume, number4159.234-2021 Semester 1Task B output: all the items in the library:The initial value of Average ratingshould be set to 0.0 for all items no rating at the beginningThe initial value of Number ofreviewers should be set to 0 forall items no reviewer at thebeginningThe initial value of Statusshould be set to available forall items not on loan yetFirst, Output allitems details oneby oneThe initial value of Average ratingshould be set to 0.0 for all items no rating at the beginningThe initial value of Number ofreviewers should be set to 0 forall items no reviewer at thebeginningThe initial value of Statusshould be set to available forall items not on loan yetFirst, Output allitems details oneby one5159.234-2021 Semester 16159.234-2021 Semester 1After you output all items, prompt these options toallow the user to choose a search method7159.234-2021 Semester 1Task C: Prompt questions to allow the user to select all the functions:If b is entered, previousoptions will be prompted8159.234-2021 Semester 1The items status changed to onloan after being borrowedDue date is current date + max number ofdays for borrowing.To calculate data in Java, you may use javalibrary java.util.Calendar,java.text.SimpleDateFormat, etc.Only one rating is available so the userentered rating value (8 in this example) equalto the Average ratingNumber of reviewers changedfrom 0 to 1 after the first rating9159.234-2021 Semester 1Multiple rating for one item is allowed from oneuser, so after the second rating, the Averagerating is: (8+6)/2=7Status becomes availableafter the item is returnedNumber of reviewers changed from 1 to2 after the second rating10159.234-2021 Semester 1There are two items whose titlesinclude Lord see number *1and number *2请加QQ:99515681 或邮箱:99515681@qq.com WX:codehelp

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导