Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Why is the players name not changing ? Any help with my code ? I want to do two games but the second game with

Why is the players name not changing ? Any help with my code ? I want to do two games but the second game with a different name . Java
image text in transcribed
image text in transcribed
image text in transcribed
Player.java Game.java x gameDriver.java 1 package CHPP; 2 3 public class Game { 4 private Player player; 5 6e public Game(Playerll player) 7 8 this.player = new Player player. length); 9 for(int i = 0; i max) 42 43 max = player[i].getScore(); 44 index = 1; 45 46 return player(index); 48 49 ww non*EASERSHES Eelipe File SOOD Recto Navigate Search Project Run Window eclipse-workspace - Chapter 182PPE .. Player.java Game.java gameDriver.java X 1 package CHPP: 2 3 public class gameDriver { 40 public static void main(String[] args) Player player = new Player [4]; player(0] = new Player("Joe"); player [1] = new Player("Sam"); 8 player [2] = new Player("Mary"); 9 player(3) = new Player("Sue"); 10 11 Game game = new Game(player); game.start(); game.end(); Player winner = game, decideWinner(); 15 System.out.println("The winner is: " + Winner); 16 17 Player() s1 = new Player [4]; si[= new Player("ben"); s1[1] = new Player("fake"); $1[2] = new Player("rose"); s1[3] = new Player("mike); Game gamei = new Game(s1); game.starto: game.end(); 31 Writable 6.07 21 60 Problems Javadoc Declaration Consolex *** BEBEELD sterminated> gameDriver (Java Application) /Library/Java/JavaVirtual Machines/jdk-13.0.2.dk/Contents/Hon Game has started Player: Joe Score:53 Rank:Level 1 Player:Sam Score: 35 Rank: Level 1 Player:Mary Score:33 Rank:Level 1 Player:Sue Score:63 Rank:Level 1 Game Ended The winner is: Player:Sue Score: 63 Rank:Level 1 Game has started Player:Joe Score: 105 Rank: Level 1 Player:Sam Score:79 Rank:Level 1 Player:Mary Score:66 Rank: Level 1 Player:Sue Score: 100 Rank:Level 1 Game Ended. 32.28 636 199M of 256M

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 Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

Appreciate the advantages of arbitration

Answered: 1 week ago

Question

2. Why?

Answered: 1 week ago

Question

1. Where do these biases come from?

Answered: 1 week ago