1. Write a program that accepts ID, Name, E-mail address and Contact No. of all the students in a class and saves them in an array. Ask the user for the size of the class and the student details.
Meka iwara karanna help ekak dendoooooooooooo
pahala tiyenne mama liwwa programme eka
.....................................................................................................................
import javax.swing.*;
public class ClassReg{
public static void main(String[] args){
String classsize=JOptionPane.showInputDialog("Enter the number of students in the class?");
int students=Integer.parseInt(classsize);
int[] stid=new int[students];
String[] stname=new String[students];
String[] stphone=new String[students];
String[] stemail=new String[students];
for(int i=0;i<students;i++){
String studentid=JOptionPane.showInputDialog("Enter ID of the student "+ (i+1));
int idno=Integer.parseInt(studentid);
stid=idno;
String studentname=JOptionPane.showInputDialog("Enter NAME of the student "+ (i+1));
stname=studentname;
String studentphone=JOptionPane.showInputDialog("Enter contact number of the student "+ (i+1));
stphone=studentphone;
String studentmail=JOptionPane.showInputDialog("Enter the Email address of the student?"+ (i+1));
stemail=studentmail;
system.out.println("student id is "+idno +", " +" student name is "+stname+""+" phoneno is"+stphone+","+"email address is"+stemail);
}
}
}