The title might sound confusing, so here is what I want to do:
I am currently working on a school project, and I have to make a rock, paper, scissors game.
I am almost done and only need one more thing.
I have two methods (bigWinner and finalResult)
In method 1 (bigWinner), I have the instance variables int totalwins
, int totallost
, and int totaldraw
.
public static String bigWinner (int totalwins, int totallost, int totaldraw) {
System.out.println ("You won " + totalwins + " games and " + "The Computer won " + totallost + "");
if (totalwins > totallost ){System.out.print ("Congrats! You won!");}
if (totalwins < totallost ){System.out.print ("Sorry, you lost.");}
if (totalwins == totallost){System.out.print ("It's a draw.");}
return "";
}
Now, In my second method (finalResult), I have to tell who is the overall winner.
public String FinalResult (int win,int lose) {
win =; //Need Fixing
lose =; //Need Fixing
if (win >lose ){System.out.print ("Congrats! You won the game!");}
if (win <lose ){System.out.print ("Sorry, you lost the game.");}
if (win == lose ){System.out.print ("It's a draw.");}
return "";
}
As I added in the comments in the code, win and lose does not have a value.
What I want to do is give the value of totallost and totalwins in bigWinner to win and lose like this :
win = (VALUE OF totalwins, in bigWinner);
lose = (VALUE OF totallost, in bigWinner);
What could be done?
Thanks in advance.