Question: This assessment requires you to design, implement and test a programme written in Java. The programme must use the command line interface (i.e., it must
This assessment requires you to design, implement and test a programme written in Java. The programme must use the command line interface (i.e., it must not have a GUI) The submission must be in the form of a complete IntelliJ IDEA project. The specification for the program is as follows: the program shall enable a user to maintain a simple electronic records system containing details of items such as a collection. You should choose your own item type, but some examples, if you are struggling, are as follows: dolls; cars; past holiday destinations; music; jewellery; antiques; cars; stamps; coins; figurines; whisky; sporting records; or stocks and shares. If youre not sure whether an idea you have is suitable, please check with your tutor. Only select one type of item to store. You must not select an item type which is similar to any of the exemplars used in the course. If you are being reassessed the type of item stored must differ from any previous submissions. As a minimum requirement, the program shall allow the user to input, store, retrieve and output relevant data. Additionally, the program may support editing, searching, sorting, aggregation and/or manipulation of the data There is scope to include additional functionality, such as statistical analysis for example, but care must be taken to keep the project manageable. You must not use any third-party libraries/packages (except JUnit). For the avoidance of doubt, the only import statements permitted are ones starting import java., though you may add import statements for your own packages if you create more than one. 1. A working program implemented in Java. As a minimum, it must enable the user to enter data, which must be stored (so it persists between application launches), and it must be able to retrieve the data from storage and present it to the user. Your program code should be self-documenting this means it must use meaningful class, method, and variable names; be clearly commented where necessary and indented to reflect the logic of the program, and control mechanisms such as loops, conditions and data validation routines should be implemented correctly. The submitted project should include 5 records which must be loaded from a saved file when the application is run (Do not include these items in the Java code) To obtain a pass mark The application must allow the user to enter details pertaining to an item in a collection. More than one piece of data must be stored in relation to each item (the name of the item will not suffice). A class must be used to represent the item being stored. o This class must have at least two properties, and a maximum of 5 o There must be at least two different types of properties o It must have a constructor with parameters which must be used o It must have appropriate getters (accessors) o Fields in the class must be private o The class must be in its own file, separate from the rest of the program logic Data must persist between launches of the operation (i.e., it must be stored in a file). o This functionality must be implemented using Serializable. The user must be able to display a list of all items previously added to the collection. The user must be able to choose to exit the application and the application must only terminate when the user chooses to exit (i.e., they should be presented with some form of menu once they have completed any given operation, rather than having to relaunch the application multiple times) You should not set a limit on the number of items that can be stored (you can, however, assume it will be fine to write an entire collection to persistent storage in one go, and should not worry about the performance implications this could have for large collections). To obtain a higher mark, in addition to the above functionality The application must not throw exception that is not caught (i.e., crash) if the user were to input a value that is not in the format expected When values are entered by the user in the wrong format, the application will allow them to try again until they get it correct, without losing any data entered so far. A user must be able to remove individual items from the collection. A user must be able to edit individual properties of individual items. Replacement of one object with another does not constitute editing for the purpose of this criteria, therefore, to meet this criterion, the class must have at least one setter (mutator) One of the properties must store an enum value Unit tests must adequately test a fair proportion of the code. The user must be able to sort the items in the collection on one of its properties (for example, for a Blu-ray this could be Title, Rating, Price etc.) This functionality must be implemented using by implementing the Comparable interface. There must not be repeated code in the implementation, nor should there be any particularly large methods1 (i.e., code should be refactored into (small) methods where appropriate) To obtain a first-class mark, in addition to the above functionality One or more of the following elements of functionality will be implemented: The ability to sort on more than one property of the item being stored (using Comparator) The ability to perform operations on the data in the collection (for example a Blu-Ray collection might allow you to calculate the total value of all records based on the purchase price, or identify average release year, or most commonly appearing actress / actor). Allow the user to store more specific versions of the thing stored in the collection with additional attributes implemented using inheritance. For example, if the primary type of item stored in a collection was Car then there could be subclasses of ElectricCar with a property of batteryCapacity, and a subclass of InternalCombustionEngineCar with a property of fuelType I have done some part of this in the code below please complete the code. import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class CollectionApp implements Serializable { // List to store collection items private static final ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
