The context for this assignment (Part 1 and Part 2) is a ‘The WAR- WIN or LOSE Game Development’ for calculating and displaying a WIN or LOSE. This assignment will test a student’s knowledge of and skills in writing application software for a task, understanding the business rules of a particular problem, coding these in a computer program, developing a graphical user interface. For this assignment, students will use the Java programming language and development will be on the NetBeans IDE platform. This assignment consists of 2 stages, • Part 1: A simple console program (no GUI) • Part 2: The same but wrapped in a GUI
ICT104: Programming Assignment Compiled By: Divya Leekha T2 2019 Page | 1 T22019: ICT104 Program Design and Development Programming Assignment Assessment type: Programming Assignment Purpose: This assessment will allow students to demonstrate their understanding of Java programming and object-oriented concepts, the use of list classes in collection framework, and the use of graphical features using swing. This assessment contributes to Learning Outcomes c and d. Value: 20% Due Date: Week 10 Sunday 23:55 Task Details: Topic: Develop Java application based on the given scenario: individual assignment Assignment Details: The context for this assignment (Part 1 and Part 2) is a ‘The WAR- WIN or LOSE Game Development’ for calculating and displaying a WIN or LOSE. This assignment will test a student’s knowledge of and skills in writing application software for a task, understanding the business rules of a particular problem, coding these in a computer program, developing a graphical user interface. For this assignment, students will use the Java programming language and development will be on the NetBeans IDE platform. This assignment consists of 2 stages, • Part 1: A simple console program (no GUI) • Part 2: The same but wrapped in a GUI The WAR – WIN or LOSE Game Development Preamble: A new fighting game has been introduced. There are N number of terrorists with each having some strength. There are N soldiers in the game with each having some energy. The energy is used to kill terrorists. The terrorist can be killed only if the energy of the soldier is greater than the strength of the terrorist. John is playing the game and at a time wants to know if it is possible for him to win the game or not with the given set of energies and strengths of soldiers and terrorists. John wins the game if his soldiers can kill all the terrorists with the allotted energy. ICT104: Programming Assignment Compiled By: Divya Leekha T2 2019 Page | 2 There would be specific number of Soldiers with different Energy levels and specific number of Terrorists with different Strengths. (Important: The value of number of Soldiers and terrorists is as per the last two digits of student ID from the following table.) Number of Soldiers and that of Terrorists Last 2 Digits of your Student ID 1) 7 Soldiers and 7 Terrorists 00 to 09 2) 8 Soldiers and 8 Terrorists 10 to 19 3) 9 Soldiers and 9 Terrorists 20 to 29 4) 10 Soldiers and 10 Terrorists 30 to 39 5) 11 Soldiers and 11 Terrorists 40 to 49 6) 12 Soldiers and 12 Terrorists 50 to 59 7) 13 Soldiers and 13 Terrorists 60 to 69 8) 5 Soldiers and 5 Terrorists 70 to 79 9) 4 Soldiers and 4 Terrorists 80 to 89 10) 3 Soldiers and 3 Terrorists 90 to 99 A worked-up example: Let us assume that there are 6 Soldiers and 6 Terrorists for a scenario. Each Soldier from a given team can fight with only 1 Terrorist from a given team. Algorithm needs to be developed which would check, if 6 pairs of Soldier and Terrorists (Any 1 Soldier from a Team could be mapped to any 1 Terrorists from a Team) are possible where every Solder can kill that Terrorist. If this is possible then only John would WIN. But, after trying out all the possible mappings of Soldier-Terrorist pairs, even if single Terrorist remains, who could not be killed by corresponding Soldier, then John would LOSE. Explanation ICT104: Programming Assignment Compiled By: Divya Leekha T2 2019 Page | 3 The number of Soldiers and Terrorists – 6 The Energies of different Soldiers – 150 789 234 400 452 500 [Soldier1:150, Soldier2:789, Soldier3:234, Soldier4:400, Soldier5:452, Soldier6:500] The Strengths of different Terrorists - 512 90 343 243 478 112 [Terrorist1:512, Terrorist2:90, Terrorist3:343, Terrorist4:243, Terrorist5:478, Terrorist6:112] For the given test case, If we shuffle the soldiers and terrorists, we can come up with below mappings where all the terrorists can be killed by respective soldiers. Soldier Terrorist RESULT 500 478 WIN 789 512 WIN 234 112 WIN 400 243 WIN 452 343 WIN 150 90 WIN As all the terrorists can be killed by the corresponding soldiers, John will WIN the game. Thus, the final output is WIN. Generate the below User Interface and ask the user to enter the data for Soldiers and Terrorists. Java Swing components need to be used to generate the below User Interface. ICT104: Programming Assignment Compiled By: Divya Leekha T2 2019 Page | 4 The player would enter Energy Levels of Soldiers (as Integers) and Strengths of Terrorists (as Integers). Upon clicking the button captioned Start War, the Algorithm would compute the result either as WIN or LOSE. (As explained in above Explanation section). The WIN scenario: The Energies of different Soldiers – 150 789 234 400 452 500 [Soldier1:150, Soldier2:789, Soldier3:234, Soldier4:400, Soldier5:452, Soldier6:500] ICT104: Programming Assignment Compiled By: Divya Leekha T2 2019 Page | 5 The Strengths of different Terrorists - 512 90 343 243 478 112 [Terrorist1:512, Terrorist2:90, Terrorist3:343, Terrorist4:243, Terrorist5:478, Terrorist6:112] The LOSE scenario: [ In the above data, just modified the Strength of Terrorist 6 as 235] ICT104: Programming Assignment Compiled By: Divya Leekha T2 2019 Page | 6 ICT104: Programming Assignment Compiled By: Divya Leekha T2 2019 Page | 7 Marking Rubrics: Criteria (Unsatisfact ory) Fail (Satisfactory) Pass (Effective) Credit (Excellent) Distinction (Exceptional) High Distinction % Delivery No task submitte d. Complete d less than 50% of the requirem ents. Not submitte d in correct format Completed between 5075% of the requirements. Submitted in correct format Completed between 7585% of the requirements. Submitted in correct format Completed between 8595% of the requirements. Submitted in correct format Completed between 95-100% of the requirements. Submitted in correct format 3 Coding Standards No name, date, or assignment title included. Poor use of white space (indentatio n, blank lines). Disorganiz ed and messy. Poor use of variables (many global variables, ambiguo us naming). Missing information on name, date, or assignment title included. White space (indentation, blank lines) used properly. Organized work use of variables (many global variables, ambiguous naming). Includes name, date, and assignment title. White space makes program fairly easy to read. Organized work. Good use of variables (few global variables, unambiguous naming). Includes name, date, and assignment title. Good use of white space. Organized work. Good use of variables (no global variables, unambiguous naming). Includes name, date, and assignment title. Excellent use of white space. Creatively organized work. Excellent use of variables (no global variables, unambiguous naming). 3 Documentation No documentat ion included. Basic documentation has been completed Basic documentation has been completed including descriptions of all variables. Purpose is noted for each function. Clearly documented including descriptions of all variables. Specific purpose is noted for each function and control structure. Clearly and effectively documented including descriptions of all variables. Specific purpose is noted for each function, control structure, input requirements, and output results. 3 ICT104: Programming Assignment Compiled By: Divya Leekha T2 2019 Page | 8 Runtime Does not execute due to errors. User prompts are misleading or non- existent. No testing has been completed . Executes with some warning errors. Executes without errors. User prompts contain little information, poor design. Some testing has been completed. Executes without errors. User prompts are understandable, minimum use of symbols or spacing in output. Thorough testing has been completed Executes without errors excellent user prompts, good use of symbols, spacing in output. Thorough and