Ask the user to enter the data for soldiers and terrorists

Assignment Help Programming Languages
Reference no: EM132372099

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.

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.
 
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

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.

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]

The Strengths of different Terrorists - 512 90 343 243 478 112

[Terrorist1:512, Terrorist2:90, Terrorist3:343, Terrorist4:243, Terrorist5:478, Terrorist6:112]

Attachment:- Programming Assignment.rar

Reference no: EM132372099

Questions Cloud

What is the recommended screening guidelines and treatment : The 57-year-old patient noted urinary hesitancy and a decrease in the force of his urinary stream for several months. Both had progressively become worse.
Leadership style-poor leader and leadership in your field : This may be an article about a particular leader who is influential, a leadership style, a poor leader, leadership in your field, ethics in your field,
Write a summary on henry hazlitt : Write a Half page summary - Henry Hazlitt and the Failure of Keynesian Economics
Describe the agency mission and vision statements : An agency's mission statement addresses the question of "What do we do?" In essence, the mission statement identifies how the agency will get to where it wants.
Ask the user to enter the data for soldiers and terrorists : ICT104 Program Design and Development Programming-Kings Own Institute-Australia-Ask the user to enter the data for Soldiers and Terrorists
Explain the need of load balancing in today networks : MIT Australia - MN502 Overview of Network Security Assignment - Security in Networked Systems. Explain the need of load balancing in today networks
Describe the strategies for overcoming the barriers : Andre is a health care administrator for a public health agency in a densely populated urban area. His department just received funding to implement.
Train a neural network on the weed seed dataset : Soft Computing Class - Neural Networks - Train a neural network on the Cancer dataset so it's not over or under trained then fill out a short form/report
What is your definition of spiritual care : What is your definition of spiritual care? How does it differ or accord with the description given in the topic readings? Explain. The response must be typed.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd