Java application to simulate the duel

Assignment Help Business Management
Reference no: EM131233243

In the land of Puzzlevania, Aaron, Bob, and Charlie had an argument over which one of them was the greatest puzzler of all time. To end the argument once and for all, they agreed on a duel to the death. Aaron was a poor shooter and only hit his target with a probability of 1/3. Bob was a bit better and hit his target with a probability of ½. Charlie was an expert marksman and never missed. A hit means a kill and the person hit drops out of the duel.

To compensate for the inequities in their marksmanship skills, the three decided that they would fire in turns, starting with Aaron, followed by Bob, and then by Charlie. The cycle would repeat until there was one man standing, and that man would be the Greatest Puzzler of All Time.

An obvious and reasonable strategy is for each man to shoot at the most accurate shooter still alive, on the grounds this shooter is the deadliest and has the best chance of hitting back.

Write a Java application to simulate the duel using this strategy. Your application should use random numbers and the probabilities given in the problem to determine whether a shooter hits the target. Create a class named Dueler that contains the dueler's name and shooting accuracy, a boolean indicating whether the dueler is still alive and a method shootAtTarget(Dueler target) that sets the target to dead if the dueler hits his target (using a random number and the shooting accuracy) and does nothing otherwise.

Once you can simulate a single duel, add a loop to your application that simulates 1,000 duels. Count the number of times that each contestant wins and prints the probability of winning for each contestant (ie., for Aaron, your application might output "Aaron won 395/1,000 duels or 39.5%").

Reference no: EM131233243

Questions Cloud

Why does wheeled coach have excess inventory : Why does Wheeled Coach have excess inventory? What kind of a plan would you suggest for dealing with it? Wheeled Coach, the world’s largest manufacturer of ambulances, builds thousands of different, constantly changing configurations of its products...
Amortized cost of a binary counter : How do you prove that the amortized cost of a binary counter that can increment and decrement is O(log n)?
What is an information system : What is an information system? How does it work? What are its management, organization, and technology components? Why are complementary assets essential for ensuring that information systems provide genuine value for organizations?
What provisions in the constitution to ensure a fair trial : What provisions in the Constitution are designed to ensure a fair trial? What are the most important provisions in the U.S. Constitution affecting civil rights policies?
Java application to simulate the duel : Write a Java application to simulate the duel using this strategy. Your application should use random numbers and the probabilities given in the problem to determine whether a shooter hits the target
Master schedules are expressed in three different ways : Master schedules are expressed in three different ways, depending on whether the process is continuous, a job shop, or repetitive. Compare and contrast the three ways master schedules are expressed and used.
Research development of the us social security program : Research the development and administration of the U.S. Social Security program. Include its history, current structure, and calculation of benefits; also, include other benefits available through the program.
Division between content and non-content : 1. Explain the significance of the division between "content" and "non-content" as it relates to federal electronic surveillance law.
Determine the final state and find the heat transfer : We open the valve and let all the water come to a single uniform state while we transfer enough heat to have a final pressure of 300 kPa. Give the two property values that determine the final state and find the heat transfer.

Reviews

Write a Review

Business Management Questions & Answers

  Discuss factors that affect the exchange rate

Discuss factors that affect the exchange rate

  Defined bfoqs lead to problems

Research the term BFOQ as well as find at least one article Explain its standing and relevance to HRM. How might not suitably incorporating well defined BFOQs lead to problems for the organization?

  Explain jack welch''s leadership style

How would you describe Jack Welch's leadership style? Was his effect on organizational culture positive or negative? Defend your argument.

  Relationship with a current or past boss and why

How would you rate/describe your relationship with a current or past boss and why? Given what we are learning, what will you do differently in the future to improve your relationship with your boss

  Describe the nature of leadership

Write about 600 words about those questions (with reliable referenc not online referenc:Describe the nature of leadership and how it differs from management.

  Costco''s business strategy provide value to customer

What recommendations could you provide regarding Costco's strengths and opportunities for improvement?

  Describe the various ways that firms raise capital

Describe the various ways that firms raise capital and identify the pros and cons of each method. What type of investor is most likely to be attracted to online trading? What type of investor prefers a full-service broker?

  Key communication concepts you have gained

Determine the three (3) key communication concepts you have gained from this class. Explain the strengths and weaknesses of each. Propose how do you expect to use these concepts in your organization.

  Every country in the world is constructed around the same

Every country in the world is constructed around the same set of institutional frameworks that differ only in how governments manage them. Identify the specific components of an institution. Next, use two (2) examples of institutions -such as ..

  Performance managementcan someone explain the

performance managementcan someone explain the characteristics of the performance management system in use in the

  Business is abusing its power with respect to invasion

1. Do you think business is abusing its power with respect to invasion of privacy of consumers? Is surveillance of consumer's in the marketplace a fair practice? Which particular practice do you think is the most questionable?

  Maximum expected monetary value

1. Suppose that the management of Theme Park, Inc., has decided that three is a .35 probability that the motel's application will be approved. Chapter 5 Supplement, problem a. If management uses maximum expected monetary value as the decision crite..

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