loading...

CS506 Web Design and Development Assignment 1 solution Fall 2012

Question:                                                                                              

You have to develop a simple console base application, which reads the students records from “students.txt” file and displays each student’s information in form of table. The program should also count and display the number of alphabets, spaces, integers, words, characters and lines from the file in tabular form given at the end of following output:

Hints:

To manage student information use Student class.

To store multiple students record use ArrayList.

Idea Solution:

Download Complete solution Here

this is student class

class Student{
String name;
String rolnum;
String clas;
String phoneNum;
String program;
//parameterized constructor 

public Student(String n,String r, String c,String p,String pr){
name = n;
rolnum = r;
clas=c;
phoneNum = p;
program=pr;
}
//Print method display student record
public void print(){
System.out.println(“______________________________ _____________________________________”);
System.out.println(“:S-NAME”+” “+”: S-ROLL NO”+” ” +”: S-CLASS” + ” “+”: S-PHONE NO”+” :S-PROGRAME”);
System.out.println(“______________________________ _____________________________________”);
System.out.println(“:”+name+” :”+rolnum +” :” +clas+” :”+phoneNum+” :”+program);
System.out.println(“——————————————————————-“);

}
}

and when you are done with student class

in driver class u need 
aArrayList<Object> (); of object
connect stream to file student.txt
token to split line
initialize student object 
for loop to retrieve objects

 

DOWNLOAD SOLUTION HERE
loading...