写作FIT9131程序设计、Java程序

” 写作FIT9131程序设计、Java程序FIT9131 Semester 1 2021 Assignment 225 April 2021 1Used Car Warehouse Database SystemDue Date: 10:00pm on Friday in Week 12 (28 May 2021)IntroductionThis assignment is worth 25% of the marks for your final assessment in this unit. Heavy penalties willapply for late submission. This is an individual assignment and must be entirely your own work. You mustattribute the source of any part of your Code which you have not written yourself. Please read the section onplagiarism in this document. Your program will be checked with a code similarity detector. Please note thesection on plagiarism in this document.The assignment must be done using the BlueJ environment. All user input to the system, and systemoutput to the user, must be done at the BlueJ terminal window. No other graphical interfaces are to beused (nor assessed) in your program.The Java source code for this assignment must be implemented according to the FIT9131 Java CodingStandards.Any points needing clarification should be discussed with your tutor in your lab classes. You should notmake any assumptions about the program without consulting your tutor.Learning outcomes1) Design, construct, test and document small computer programs using Java.2) Interpret and demonstrate software engineering principles of maintainability, readability, andmodularisation.3) Explain and apply the concepts of the object-oriented style of programming.SpecificationFor this assignment you are required to write a program that implements a simple Used Car WarehouseDatabase System. This section specifies the required functionality of the program. Only a simple textinterface (using the BlueJ Terminal Window) is required for this program; however, more marks will begained for a program that is Easy to follow with clear information/error messages to the user.Even though this program is functionally very different from the program you wrote in Assignment 1, youshould be able to re-use much of your previous code here – if you have designed the classes/logic in yourprevious program properly. This is one of the major benefits of an object-oriented program – the ability tore-use classes.FIT9131 Semester 1 2021 Assignment 225 April 2021 2The aim of the Used Car Warehouse Database System is for a virtual warehouse to keep a database of theused cars in the warehouse, and to perform operations such as searching for cars, adding/deleting/editingcars, displaying the details of cars, etc.The Used Car Warehouse Database System should provide the following features: maintains a list (using a Java Collection class) of Car objectso each Car object represents a single caro cars can be searched/added/deleted/edited from the list maintains a list (using a Java Collection class) of CarMaker objectso each CarMaker object represents a car manufacturer (maker) produces a report of cars based on some criteria loads a list of cars from a text file; saves the list of current cars to a text file loads a list of car makers from a text fileYou are to demonstrate the following programming techniques in your program: reading/writing data from/to text files using appropriate Java Collection classes to store data (including embedded objects) manipulating the data in the collection(s) performing simple searches, filtered by some given criteria using program constructs such as repetitions selections using appropriate classes to represent objects in the programThere will be a description of the Car and CarMaker classes (and the collection classes which store them)later in this document.You are also required to produce a partial Test Strategy for your program.FIT9131 Semester 1 2021 Assignment 225 April 2021 3Program LogicWhen the Used Car Warehouse Database System starts, it should automatically load 2 text files: usedcars.txt which contains details of all used cars currently kept by the warehouse carmakers.txt which contains details of all available car makers known to the warehouseThe actual formats of these text files are described later in this document. The data loaded should be storedin some appropriate Data structures (the databases stored in memory). No other reading from (or writingto) file is required while the program is in operation, until the user chooses to exit, at which point theprogram saves all the in-memory cars data back to the same text file (usedcars.txt) thecarmakers data does not need to be saved as it is not modified by this program.In other words, all the file I/O operations are performed automatically by the program, once at the start andonce at the end, and require no interactions with the user.When the program is running, it should repeatedly display a main menu with these options:(1) Search Cars(2) Add Car(3) Delete Car(4) Edit Car(5) Exit SystemOption (1) of the main menu allows the user to search for cars in the database. The user should be askedwhat criteria(s) he/she wants to use to search for cars. The following sub-menu and options should bedisplayed when this option is selected:Car Searching Options:(1) By Registration Number(2) By Car Make and Car Model(3) By Car Age(4) By Price (range)(5) Back to Main MenuFIT9131 Semester 1 2021 Assignment 225 April 2021 4Sub-menu operations: Option (1): the program should ask the user to input a registration number. A valid registrationnumber should only contain a maximum 6-character combination of English alphabet ordigit (that is, A-Z, a-z or 0-9). If the input contains any invalid character (e.g. emptyspace, #, , \ etc.) or more than 6 characters, an error message should be displayed andthe user is prompted for another valid input. If it is a valid input, the database will be searchedfor the car matching the specified car registration number. If found, all information for this carshould be displayed; otherwise, some sensible error message (e.g. No such car with thisRegistration Number) should be displayed. Option (2): the program should ask the user to input a Car Make and Model (eg. Toyota andCorolla). Important requirement – when entering the make and model, the user must be ableto select from a list of available values (values are read from the carmakers input file whenthe program starts) instead of manually typing in the values. When entering the model, the usercan also input a Special value of ANY, to display all car models from this Car Maker from thedatabase. As in sub-menu Option (1), the program should display the appropriate search results. Option (3): the program should ask the user to input a non-negative integer (e.g. 0, 1, 5, 12 etc.)to indicate the maximum age of cars they want to search. The entered value should again bevalidated. As in sub-menu Option (1), the program should display the appropriate search results.For example, if the user inputs 0, all cars made in 2021 (current year) should be displayed. If theuser inputs 3, all cars made in 2018, 2019, 2020, 2021 should be displayed. Option (4): the program should ask the user to input a minimum price and a maximum price ofcars they want to search. Both inputs should be positive integers and the maximum price shouldbe greater than the minimum price. As in sub-menu Option (1), the program should display theappropriate search results. For example, if the user inputs minimum price = 1000 and maximumprice = 3000, all cars priced from $1000 to $3000 (both inclusive) should be displayed. Option (5): the program should go back to the main menu.Option (2) of the main menu allows the user to add a new car to the database (appropriate input validitychecking should be applied). No duplicate cars are allowed. When entering the make and model, the usermust again be able to select from a list of available values (initialized from the carmakers input file).Option (3) of the main menu allows the user to delete an existing car from the database. The user should beasked to search the car by Registration Number (appropriate input validity checking should be applied).Option (4) of the main menu allows the user to edit an existing car from the database. The user should beasked to search the car by Registration Number (appropriate input validity checking should be applied).The only 2 fields which can be edited are the Colour and Price.Option (5) of the main menu exits the program. All the cars currently stored in the in-memory database areautomatically saved back to usedcars.txt.Additional Notes:FIT9131 Semester 1 2021 Assignment 225 April 2021 5Both the main menu and the sub-menu must be displayed repeatedly after each menu operation, until theuser chooses the appropriate exit option. All invalid inputs (including non-numeric or other speicalcharacters) should be rejected, and an error message printed.If the user chooses Options (2) in the main menu, the Car Make and Model MUST be selected from a listwhich came from the data read (at the start of the program) from carmakers.txt.Your program must deal in a sensible way with any invalid values entered by the user.For all the user interactions, the inputs/outputs can be formatted in many different ways. Discuss with yourtutor regarding how you Should implement these in your program.Your user interface need not be exactly as shown in the examples shown above. However, you shoulddiscuss with your tutor about what to include in your user interface. Keep it simple.Important: see the Program Design section below for a description of what classes you need toimplement in your program. Failure to implement those required classes will cause loss of marks.There will be some hints in the forum on Moodle later regarding how you should develop the program forthis assignment. Make sure you check them out when they are available.FIT9131 Semester 1 2021 Assignment 225 April 2021 6Important RequirementsYou must satisfy the following requirements when implementing your program: a Car object remembers the following data:o registration number: String must not be blank, must be numeric/alphabetic (e.g. 8RT2WT) maximum 6 characters must be unique (no duplicates)o year made: int between 1950-2021 (inclusive)o colour: Strings a car can have up to 3 colours (e.g. White + Blue)o car make: String any valid car maker (e.g. Toyota)o car model: String any valid model (e.g. Corolla)o price: int between 500-30000 (inclusive) a CarMaker object remembers the following data:o name: String a non-empty String, must not contain commaso available models: Strings a list of car models available from the car maker, must not contain commas you must use appropriate Java data structures to store the Car and CarMaker objects in yourprogram see the Program Design section for more details.FIT9131 Semester 1 2021 Assignment 225 April 2021 7 you may assume that the input data files are always in the correct formats (see below) – ie. there isno need to validate the actual data when reading them in. all operations must be applied to the in-memory data structures – there must not be constantreading/writing to/from the data file, except once at the start (when the program loads all data fromthe files) and once at the end (when the program saves all data back to the file, when it exits) the program must not crash when accepting user inputs, regardless of what the user enters. all Car Registration Numbers are unique – if a car with the given Car Registration Number isalready in the database, it cannot be added again, and an error message should be displayed. there is no limit to how Many cars can be stored. there is no limit to how many car makers can be stored.o there is no limit to how many models are available from a particular car maker. when performing searches, all search strings are not case-sensitive (e.g. there is no differencebetween 178XYZ, 178xyz or 178XyZ for car registration number).Input File FormatsThe first input data file (usedcars.txt) has the following format for each line (note that there is noempty space in between a word and a comma). If a car has less than 3 colours, the corresponding fields areempty.CarRego,YearMade,Colour1,Colour2,Colour3,CarMake,CarModel,Price CarRego is a String. YearMade is a positive integer. Colour1/Colour2/Colour3 are Strings. CarMake is a String with no empty space inside. CarModel is a String. Price is a positive integer.FIT9131 Semester 1 2021 Assignment 225 April 2021 8Here is an example of a usedcars.txt file:1YX98J,2014,Black,White,,Toyota,RAV4,25000ABC132,2007,Yellow,,,Toyota,Corolla,5900MARY21,2017,Dark Grey,Blue,Red,BMW,X5,5513290210,2012,Blue,Light Green,,Honda,Civic,2000The second input data file (carmakers.txt) has the following format for each line (note that there is noempty space in between a word and a comma). A car maker can have as many models as there are data inthe file.Make,Model1,Model2,Model3,Model4,Model5, Make is a String representing a Car Maker. Model1/Model2/ are Strings representing the models available for that Car Maker.Here is an example of a Carmakers.txt file:Toyota,Prius,Corolla,Camry,CelicaHolden,Commodore,Barina,Apollo,AstraHyundai,Sonata,Elantra,TucsonKia,Sportage,Stinger,Carnival,SorentoMyOwnBrand,Thor,Ironman,Hulk,Superman,Thanos,ShrekYou may assume: the strings which represent the various fields (colours/make/etc) do not contains commas. this program does not provide the functionality to edit the carmakers list (i.e. use a text editor toedit carmakers.txt if you wish to modify the list).FIT9131 Semester 1 2021 Assignment 225 April 2021 9Program DesignYour program must demonstrate your understanding of the object-oriented concepts and generalprogramming constructs presented in FIT9131. Consider carefully your choice of classes, how they interactand the fields and methods of each class.You must use appropriate data structures to store the various objects (list of cars, list of car makers, list ofmodels, etc) in the program. If you do not understand what this means, ask your tutor now.You must be able to justify the choice of the data structures during your interview. You must document anyadditional assumptions you made.Appropriate validations of values for fields and local variables should also be implemented. You should notallow an object of a class to be initialized/set to an invalid state (ie. put some simple validations in yourmutator methods).Discuss with your tutor what classes are appropriate, and how they interact with each other. The mainrequirements are:(1) the cars must be implemented as objects, and they must be stored in some appropriate Javacollections (e.g. an ArrayList of Car)(2) the car makers must also be implemented as objects, and they must be stored in some appropriateJava collections (e.g. an ArrayList of CarMaker)Your program must deal with invalid values entered by the user in a sensible manner. For instance, if a userenters abc when a number is expected, your program should not crash.Exception handling should be used where appropriate.All on-screen input/output should be formatted in a user-friendly manner. Sensible error messages should bedisplayed whenever appropriate (e.g. entering a duplicate car to add, entering a price outside the allowablevalid range, etc).Note: The description of the programs logic/design is purposely left vague, to give you some room toexercise your own design and creativity. Discuss with your tutor about what/how to implement.FIT9131 Semester 1 2021 Assignment 225 April 2021 10Test StrategyFor this assignment, you are required to produce a partial Test Strategy for the program.There is no need to Produce Test Strategy for any other classes you have used in your program.You must provide a Test Plan, plus detailed sets of Test Data, Expected Results and Actual Results for theCar class.Your Test Strategy will be only for one class – the Car class.Your program must consist of at least these classes: CarWarehouse main class, which contains the programs main logic Car represents a single car CarMaker represents a single car maker CarDatabase represents a list of cars CarMakerDatabase represents a list of car makersany other appropriate classes (e.g. a Menu class) are to be discussed with your own tutorFIT9131 Semester 1 2021 Assignment 225 April 2021 11AssessmentAssessment for this assignment will be done via an interview with your tutor. The marks will be allocated asfollows: 10% – Test Strategy for the Car class. 35% – Java Code Object-Oriented design quality. This will be assessed on appropriateimplementation of classes, fields, constructors, methods, and validations of the objects states. 55% – Program Functionality in accordance with the requirements.You must submit your work by the submission deadline on the due date (a late penalty of 10% per day,inclusive of weekends, of the possible marks will apply – up to a maximum of 100%). There will be noextensions – so start working on it early.Marks will be deducted for incomplete/untidy Submissions, and non-conformances to the FIT9131 JavaCoding Standards.All submitted source code must compile. Any submission that does not compile, as submitted, will receive agrade of N.InterviewYou will be asked to Demonstrate your program at an interview following the submission date. At theinterview you can also expect to be asked to explain your code/design, modify your code, and discuss yourdesign decisions and alternatives. Marks will not be awarded for any section of code or functionality that astudent cannot explain satisfactorily (the marker may also delete excessive in-code comments before you areasked to explain that code).In other words, you will be assessed on your understanding of the code, and not on the actual code itself.The interviews will be arranged during week 12 and will take place online via Zoom or other video facilityafter that week. You must have audio and video available and operating during the interview. It is yourresponsibility to make yourself available for an interview time and ensure that you have the audio and videocapabilities. Any student who does not attend an interview will receive a mark of 0 for the assignment.FIT9131 Semester 1 2021 Assignment 225 April 2021 12Submission RequirementsThe assignment must be uploaded to Moodle on or before the due date. The link to upload the assignmentwill be made available in the Assignments section of the units Moodle site before the submission deadline.The submission requirements are as follows:A ZIP file uploaded to Moodle containing the following components: the BlueJ project you created to implement your assignment. The ZIP file should be named with yourStudent ID Number. For example, if your id is 12345678, then the file should be named12345678_A2.zip. Do not name your file any other way. it is your responsibility to check that your ZIP file contains all the correct files, and is not corrupted,before you submit it. If you tutor cannot open your zip file, or if it does not contain the correct files,you will not be assessed. an MS Word document containing your Test Strategy for the Car class. (Note: The JUnit facility in BlueJis NOT to be used for this assignment) there is no need to submit a physical Assignment Cover Sheet you will be asked to accept an onlinesubmission statement when you submit the assignment.Marks will be deducted for failure to comply with any of these requirements.Warning: there will be no extensions to the due date. Any late submission will incur the 10% per daypenalty. It is strongly suggested that you submit the assignment well before the deadline, in case thereare some unexpected complications on the day (e.g. interruptions to your home internet connection).PlagiarismCheating and plagiarism are viewed as serious offences. In cases where cheating has been confirmed,students have been severely Penalised, from losing all marks for an assignment, to facing disciplinary actionat the Faculty level. Monash has several policies in relation to these offences and it is your responsibility toacquaint yourself with these.Monash Plagiarism Policy: ( httpss://www.monash.edu/students/admin/policies/academic-integrity).请加QQ:99515681 或邮箱:99515681@qq.com WX:codehelp

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