Assignment title: Java
ASSIGNMENT TO BE DONE IN JAVA ECLIPSE WITH THE CODE IN A WORD DOCUMENT AND COMMENTS EXPLAINING EACH LINE OF CODE. Your Task: For this assignment you are required to develop a programmatic solution, using the Java programming language in eclipse, to a specific problem as detailed below. You will be required to demonstrate the completed work to your tutor in order to receive a mark. During this demonstration your tutor will examine your solution and also ask questions about how the work was undertaken, and any difficulties that you had. Any awarded mark is for the demonstration and explanation of the work, rather than for the submitted work itself. The Problem: Many computer programs are designed to process data. You have been given the task of producing a program which examines some textual data, validates it for correctness, performs some processing, then outputs the results in a user friendly form. The input data in this case will originate from the keyboard (but it could be expanded to use a text based file). The input will contain raw data relating to a "player's achievements on a gaming console". Each input will contain the name of the player, a list of games, information regarding the achievement score for each game, and information regarding the amount of time spent playing each game. A typical input will look like the following example: John Johnson GTA V: 120 : 1021 Minecraft : 20 : 10 Assassin's Creed IV : 90 : 800 Payday 2 : 190 : 2001 Wolfenstein TNO : 25 : 80 FarCry 4 : 55 : 862 quit From this example it can be seen that the format is as follows – : : : : : : : : .. : : when the user has finished inputting text then they type "quit". Notice how the first line carries the player name and all subsequent lines have the same form, i.e. each line contains a single game entry. Also notice how a colon character (:) is used as the field delimiter. To help manage complexity, the work has been divided into specific requirements. You can assume that the maximum number lines the user will ever type is is 100 lines. Requirement 1: To fulfil this requirement the solution must have the ability to prompt the user for input of each user's game data and accept the command "quit" when they no longer wish to type more data in. The data should be stored and then output in its entirety to the console. To gain full marks for this requirement the implementation must store the data so that it can be further processed for the further requirements below (i.e. it is not just echoing the typed in data back to the console). Each line should be broken down into its three constituent parts of title, score and minutes played. You can demonstrate that this has happened by outputting them in the following format: Player : John Johnson -------------------------------- Game: Minecraft, score= 20, minutes played= 10 Game: xxxxxx for all of the user input. At this stage you are not doing anything further with the data, but you have it in a format that you can do so in the next requirement. Uses a loop for input and processes "quit" command (5 marks) Data is output to the console after all the data has been input by the user (5 marks) Data is stored in separate arrays (or collection class) for each of title, score and minutes played (5 marks) score and minutes played should have been converted into integers (5 marks) Requirement 2: The second requirement involves extending requirement 1, so that the program examines the data stored from requirement 1 and checks it for validity. It has to be assumed that the user may have typed in data incorrectly. The program must identify invalid entries and report these to the user via messages on the console. Bear in mind the following possible issues– · The player name may be missing from the first line. (3 marks) · A game entry line may not contain the three expected fields. (2 marks) · A game entry line may not contain the correct field delimiter. (3 marks) · Numeric values in a game entry may not represent valid integer numbers. (5 marks) · The input may have blank lines, i.e. return is pressed but "quit" hasn't been typed yet (these could be ignored). (2 marks) The format in which the problems are reported is your personal choice, but better descriptions of the problem are likely to achieve better marks during assessment. (5 marks) Requirement 3: The third requirement involves aggregating the values from the input and producing a simple text based report to the console. This report should identify the following information – · The total number of games played. (1 marks) · The total achievement score of the player. (1 marks) · The total time spent on all games. (1 marks) · The total number of invalid game entries. (1 marks) · The highest score achievement (1 marks) The generated report should also contain a suitable heading containing the name of the player. The output should resemble the following – Player : John Johnson -------------------------------- Games Played: 6 Total Achievement: 500 Total Time: 4774 (79 hours and 34 minutes). Invalid entries: 0 Notice the format of the total time, higher marks will be gained if the hours and minutes are correctly calculated and shown as above. (5 marks) Important note: Only valid game entries should be used to calculate the aggregated values, e.g. if an entry contains an invalid achievement score, then the whole game should be ignored (does not contribute to games played count) and the time spent on that game should be ignored. An additional 10 marks will be awarded for anything that you add in addition to the above. For example you might read from a file instead of the keyboard, or produce a formatted report in HTML, use your imagination. Note that it may be difficult to give you a live mark for this section as it will have to be discussed between group tutors. Each requirement you provide will contribute a maximum of 20 marks towards the final grade, hence a maximum of 60 marks are achievable for this assignment. A maximum mark for a requirement will only be awarded if it fully complies with the requirement, and you are able to discuss your solution with the tutor in a knowledgeable way. Marks given in accordance above could be reduced for poorly presented code, inability to answer questions etc.