Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Learning Goals . Use random to create a simulation Code support methods* Work extensively with Array Lists : create , display and remove elements Directions

image text in transcribed
Learning Goals . Use random to create a simulation Code support methods* Work extensively with Array Lists : create , display and remove elements Directions ! 1 . 1 Create an Array List of Strings containing the names of your & " teams ' . Use humorous* names for your teams ( Dwarves , Wizards , Dinosaurs , etc . ) 2. Code a method public void play Game ( int teamA , int teamB , Arry List teams )* a. teamA and teamB are the indices ( sic . Indexes ) of the teams that are playing the current game . You will use these to retrieve the String name of the team . For our purposes a Quiddich game has four quarters " b. Each team randomly scores 0 to 4 goals worth 10 points each per quarter ( 0 - 40 points per quarter . C . Each quarter , there is a 15% chance that a team will capture the Golden snitch . If that happens the game ends immediately and that team wins . ( First determine if a team got the snitch , then if one did randomize which one wins with even probability . ) d . The method should display the results for each quarter that is played and indicate the final score or if the teams won by capturing the snitch . ai There are no ties . Play additional sudden death quarters until one team wins . f . Four method should remove the loosing team from the Array List and print a msg that that team ( using the String name ) has been eliminated from the Tourney

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

Transport Operations

Authors: Allen Stuart

2nd Edition

978-0470115398, 0470115394

Students also viewed these Programming questions

Question

5. What are the key lessons for management?

Answered: 1 week ago