Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Playing Field -values: Arra Field wheels: Array List HWheel +Playing Field +spin

ID: 3823200 • Letter: P

Question

Playing Field -values: Arra Field wheels: Array List HWheel +Playing Field +spin0 St SlotMachine: Add a set Bonus method which creates an instance of Bonus Playing Field and saves it in its playingField attribute. Add a set Regular method which creates an instance of Playing Field and saves it in its playingField attribute. Change the line in the SlotMachine constructor that createst the PlayingField object to just call the setRegular method. Bonus Playing Field added or revise this lab assignm +Bonus playingfield doub

Explanation / Answer

public class SlotMachine {
   private PlayingField playingField;
  
   public SlotMachine() {
       this.setRegular();
   }
   public void setBonus(){
       this.playingField=new BonusPlayingField();
   }
   public void setRegular(){
       this.playingField=new PlayingField();
   }
}