Question: Write a method ( or function ) named scoreGame that returns the score of a game. scoreGame receives two parameters: an int [ ] containing
Write a method or function named scoreGame that returns the score of a game. scoreGame receives two parameters: an int containing the values on the cards, and an int that stores the player's guess. Your method should return the score of the game as an int.
You will need to compute the sum of the values in the array! You may also find the Math.abs method helpful when completing this problem, but it is not required.
If you have solved this problem previously without writing a method, you may reuse your old However you may try to eliminate the score variable that we used previously.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
