import javax. swing.*;
class StudentNameGrade
{
public static void main (String[] args)
{
System.out.println("\f");
String ans = "";
String[] studentName = new String[5];
int[] studentGrade = new int[5];
while(true)
{
for (int i = 0; i<5; i++)
{
studentName[i] = JOptionPane.showInputDialog("Please enter student's name.");
studentGrade[i] = Integer.parseInt(JOptionPane.showInputDialog("Please enter student's grade."));
}
for (int i = 0; i<5; i++)
{
System.out.println(studentName[i] + " got " + studentGrade[i]);
}
ans = JOptionPane.showInputDialog("Again (y/n)?");
{
if(ans.equals("n"))
{
System.out.println("Thank you. Have a nice day!");
break;
}
}
}
}
}