Please someone help me with this java last project | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please someone help me with this java last project

import java.util.*; public class Bowling { HashMap<String, Integer> players; Bowling() { players = new HashMap<String, Integer>(); } public void addPlayer(String name, int p) { players.put(name, p); } //your code goes here } public class Program { public static void main(String[ ] args) { Bowling game = new Bowling(); Scanner sc = new Scanner(System.in); for(int i=0;i<3;i++) { String input = sc.nextLine(); String[] values = input.split(" "); String name = values[0]; int points = Integer.parseInt(values[1]); game.addPlayer(name, points); } game.getWinner(); } }

31st Mar 2022, 11:18 AM
MR KINGSHOW
MR KINGSHOW - avatar
1 Answer
0
You can add a code with the +insert... Button bottom left. If you edit this question. And you call game.getWinner(); But you didn't have defined getWinner(). //your code goes here Is a good place for this method. 😉
31st Mar 2022, 11:35 AM
Stefanoo
Stefanoo - avatar