Question: Fix java code using jGrasp 1.Need to saving results to a file as requested. 2. need to add the image of the rock paper scissors
Fix java code using jGrasp 1.Need to saving results to a file as requested. 2. need to add the image of the rock paper scissors choices in game; code below:











i import java.awt.Color; 2 import java.awt.Container; 3 import java.awt.event.*; 4 import javax.swing.*; 5 6 / ** 7 * This program implements the Rock Paper Scissors 8 * The program renamed as titled below JAN-KEN-PO. 9 * The .png images are attached with assignment, and the help window pop's up automatically when program starts. 10 * There is a "Quit" & "Cheat" button the quit button is self explanatory but the cheat button gives the user the ability to add a point without fining the game hence named cheat. 11 12 * @author Jimenez, Kainoa 13 * @assignment ICS 211 Assignment 06 14 * @date 03/09/2021 15 * @bugs No bugs in the program, if any. 16 */ 17 18 public class RPS { 19 20 static int humanWon; // use for statistic 21 22 static int win=0; 23 24 static int total=0; 25 26 static int tie=0; 27 28 public static void main(String[] args) { // main 29 30 game Panel();// launch main game 31 32 introductionPanel(); // launch instruction 33 34 } 35 36 private static void introductionPanel() { // give the instruction to the game 37 38 String text="Rock, Paper, Scissors! This game is fairly simple. Simply pick your hands whenever you are ready. InRock beats scissors, scissors beat paper and paper wrap the rock. Yes paper beats rock."; 40 JOptionPane.showMessageDialog(nula.text. "How to play!", 0, new ImageIcon(System.getProperty("user.dir") +"/image/5.gif")); 41 42 } 43 44 private static void gamePanel() { // the main game panel 45 46 JFrame frame = new JFrame ("JAN-KEN-PO (Rock, Scissors, Paper)"); // the main frame of the game 47 48 Container panel = frame.getContentPane(); // creating a container panel, so we can place buttons where we pleased 49 50 panel.setLayout(null); 51 52 String[] iconstring= new String[3]; // creating icon string name so we can place the directory in with little effort 53 54 int[] boundInt= new int[3]; // same idea 55 56 for(int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
