174k views
1 vote
Write In Java. No Print Or Println. Use Return. This Is A Codingbat Problem We Need To Write A Program To Return The Score For A Gamer. Ou

1 Answer

3 votes

Final answer:

A Java program to return a gamer's score would define a method that takes relevant inputs and calculates the score based on defined rules, and returns the calculated score as an integer.

Step-by-step explanation:

In Java, the task to write a program that calculates and returns a score for a gamer without using print or println statements can be achieved by defining a method that takes relevant inputs and returns an integer representing the score. The method signature depends on the rules that define how the score should be calculated. Below is an example of a method that could represent a simple scoring system where the score is the sum of points for each game won.

public int calculateScore(int gamesWon, int pointsPerGame) {
return gamesWon * pointsPerGame;
}

Remember to replace the example parameters and calculation logic with the actual criteria from the CodingBat problem you are trying to solve. If your problem has different parameters or a more complex scoring algorithm, adjust the method accordingly.

User Charlie Dalsass
by
8.0k points