- Joined
- Jan 10, 2021
- Posts
- 3,041
- Solutions
- 283
- Reaction
- 15,177
- Points
- 2,761
May java code samin na pinapagawa pero nahihirapan talaga ako i convert to python any idea pano iconvert to sa python huhu salamat!
Code
Code
import java.util.Scanner;
import java.util.PriorityQueue;
public class Greeting {
public static void main(String args[]) {
PriorityQueue<String> prio = new PriorityQueue<>();
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the nicknames of your classmates: ");
for(int x = 0; x < 4; x++)
prio.offer(scanner.nextLine());
System.out.print("Press H to say Hi to each of them. ");
do {
char Hi = Character.toUpperCase(scanner.next().charAt(0));
if(!prio.isEmpty())
System.out.println("Hi " + prio.remove());
else
System.out.print("Done saying Hi");
}while(true);
}
}