Obvious and reasonable strategy

Assignment Help Basic Computer Science
Reference no: EM131235101

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: EM131235101

How the unit is insulated and how it is internally vented

You may also want to consider how the unit is insulated and how it is internally vented. Although the cost of the oven is important, energy consumption, reliability and spee

Kinds of support and tools are available with visual basic

What kinds of support and tools are available with Visual Basic? Sum-up your research, and make sure to reply to each of the questions.

Presentations at internal meeting of ciso staff members

You have been invited to participate in a "lightning round" of short presentations at an internal meeting of CISO staff members. For this activity you must prepare a 3 to 5

String formed from the letters of a string

A mirror has the following pattern: LmR where L is a (possibly empty) string formed from the letters of a string, and R is the reverse of the string L. m is an pivot string wh

How many neurons constitute a neighborhood

This number should depend on network size and the default setting. However, we suggest as an exercise a careful examination of its impact on network behavior. Note that larg

Short persuasive speech

First, you want to write a short persuasive speech, just two pages long, using any one of the following five speech types: (1) stimulate, (2) convince, (3) call to action, (

It industry is becoming increasingly globalized

As you know, the IT industry is becoming increasingly globalized due to outsourcing. Select a country that your industry is likely to outsource to. Using the Internet, find

Discuss the importance of being careful

Discuss the importance of being careful with the "remote in" ability. Based on your learning this week, what kind of activities should be implemented if an unauthorized pers


Write a Review

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