We are going to write a program that will calculate the area of ​​a circle. The area enclosed by a circle of radius r is πr², w | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

We are going to write a program that will calculate the area of ​​a circle. The area enclosed by a circle of radius r is πr², w

Please any help

27th May 2021, 6:04 AM
Abdulhakim Sani
Abdulhakim Sani - avatar
5 Answers
+ 4
Post your code please
27th May 2021, 6:22 AM
Atul [Inactive]
+ 2
Can anybody help me to debug and fix the error of this code
27th May 2021, 9:11 AM
Abdulhakim Sani
Abdulhakim Sani - avatar
+ 1
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 void getWinner(){ HashMap<String, Integer> hm = new HashMap<String, Integer>(); Map.Entry<String, Integer> entryWithMaxValue = null; for (Map.Entry<String, Integer> currentEntry : hm.entrySet()) { if (entryWithMaxValue == null || currentEntry.getValue().compareTo(entryWithMaxValue.getValue()) > 0) { entryWithMaxValue = currentEntry; } } System.out.println(entryWithMaxValue.getKey()); } } 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(); } }
27th May 2021, 9:06 AM
Abdulhakim Sani
Abdulhakim Sani - avatar
+ 1
It's just remove the above text
30th Jun 2021, 2:54 PM
Rabilu Abdulaziz
Rabilu Abdulaziz - avatar
+ 1
Thanks
30th Jun 2021, 4:01 PM
Abdulhakim Sani
Abdulhakim Sani - avatar