Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Please Create a 'capture the flag' program called redTeam. You represent the blueTeam, and you begin with 20 flags. You 'battle' the red

In Java Please

image text in transcribed

image text in transcribed

Create a 'capture the flag' program called redTeam. You represent the blueTeam, and you begin with 20 flags. You 'battle' the red team in a 'game of wits,' attempting to guess their automatically generated number. jasonmyersejasons-MBP-2 \%s java redTeam Guess a number from o to 10 : 8 Red Team Guess: 3 Mr.Blue you lost!1 Your balance 1s: 18 tlags. Guess a number from o to 10: 3 Red Tearn Guess: 4 Mr.Blue you lost!! Your balance ist 16 flags. Guess a number from o to 10: Red Team Guess: 1 Mr.Blue you Lostl1 Your batance is: 14 Tlags. Guess a number from o to 16 : 9 Red Team Guess: 16 Mr.Blue you lost!1 Your balance is: 12 flags. Guess a number from o to 10: Red Team Guess: 4 Mr.Blue you lost!l Your balance ist 10 flags. Guess a number from o to 10: 4 Red Team Guess: 5 0 Suggested output (drawing 1a) The rules are simple but...deadly. If you guess CORRECT, you gain 2 flags; a WRONG guess means you lose 2 . The game ends when your balance of flags is zero, and the red team succeeds! Syntax Requirements: Two classes: blueTeam Class (blueprint) Instance variables: name (as string), flags (as int) Method: Battle - Generates redTeam's automated guess - Allows Blue Team to guess - Compares redTeam's and Blue Team's guess redTeam Class (execution class with main method) - Creates object called myBattle using blueTeam class - Creates while loop to execute until blue team's flags are 0 - Creates player name as Mr. Blue - Ensures print output is consistent with drawing 1a. Problem Two RE: 'capture the flag' program Now that you have the program working, make an improvement. Any improvement, such as counting the iterations before losing

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

303139688X, 978-3031396885

More Books

Students also viewed these Databases questions

Question

find the rate constant (k) of all experiments!

Answered: 1 week ago