Ask Question
17 October, 14:28

You'll need to implement a method called String getWinner (String user, String computer) that determines whether the user or computer won the game, and return the correct winner!

+1
Answers (1)
  1. 17 October, 15:24
    0
    The solution code is written in Java.

    String getWinner (String user, String computer) { if (status = = x) { return user; } else { return computer; } } String winner = getWinner ("User_X", "Comp_X");

    Explanation:

    A method getWinner () that take two parameters, user and computer, is written (Line 1 - 8). This method presumes that there is a global variable, status. This status variable holds the value that will decide if method should return either user or computer name as winner (Line 3, 5).

    Line 10 shows a statement that implement the getWinner () method.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “You'll need to implement a method called String getWinner (String user, String computer) that determines whether the user or computer won ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers