We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

CS506 - Web Design and Development Assignment no 02 Solution And Discussion due date Dec 11, 2015


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 21768

Attachments:

Replies to This Discussion

any one help me error on gui can,t display any thing

agar hm cmd ki bjae netbean me assignment bna k submit kren to kia galt ho gi plz tell me any one?

plz koi btae kia cmd me hi run krna zaroori h is ka b to apna cmd h

yes

bhai average calculte ka code dy do..

yes

first of all you have to make a class in notepad with the name "Student.java"

code is shown below

public static class Student{

//if there is problem while compling of static keyword remove the static word from above //line and compile and run it again 

private String name;
private String roll;
private String marks;
//default constructor
public Student(){
name=null;
roll=null;
marks=null;
}
//userdefined structor
public Student(String Name,String Rollno, String Marks){
this.name=Name;
this.roll=Rollno;
this.marks=Marks;

}
public String getName(){
return name;
}
public void setName(String name){
this.name=name;
}
public String getRoll(){
return roll;
}
public void setRoll(String Roll_no){
this.roll=Roll_no;
}
public String getMarks(){
return marks;
}
public void setMarks(String Marks){
this.marks=Marks;
}

//end of student class 

now you have to make a class named "Test.java"

public class Test {

public static void main(String[] args) {
JFrame myFrame = new JFrame();
GridLayout layout = new GridLayout(0,3);
myFrame.setLayout(layout);
ArrayList<Student> list= new ArrayList<Student>();
myFrame.add(new JLabel("Name"));
myFrame.add(new JLabel("Roll No"));
myFrame.add(new JLabel("Marks"));

String words[]= null;
String name, rollNo,marks;
// int total=0;

try{
FileReader fr= new FileReader("input.txt");
BufferedReader br= new BufferedReader(fr);
String line= br.readLine();
while(line!= null){

words = line.split(" ");
name=words[0];
rollNo=words[1];
marks=words[2];
Student student = new Student(name,rollNo,marks);
list.add(student);
line =br.readLine();
System.out.println("Name: "+student.getName()+" Roll No: "+student.getRoll()+" Marks: "+student.getMarks());
myFrame.add(new JLabel (student.getName()));
myFrame.add(new JLabel (student.getRoll()));
myFrame.add(new JLabel (student.getMarks()));
}

myFrame.setSize(400, 200);
myFrame.setVisible(true);
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
br.close();
fr.close();

}catch(Exception e){
System.out.println("File Not Found");
}
}

//end of Test File

make a folder then have these two files in it 

then compile it but before compling make an "input.txt" file in same folder 

input.txt file should look like this

Ali 1 70
Ahmad 2 60
Ayesha 3 80
Hina 4 90
Sana 5 50

you can copy these above values and paste it in notepad and save it as input.txt

but one thing i leave for you that you should have to make average of students by own self i remove that code...........

:) if there any problem can mail me at mc130400939@vu.edu.pk

this is code doesn't work ,error show 

sir kia yah solution theek hn

reached end of file while parsing................error hy

o bhai Average calculate ka he code cahey bs...

RSS

Looking For Something? Search Below

Latest Activity

★彡[ꜱʜʏɴᴀ]彡★ liked + ! ! hคຖiค khคຖ ! ! ! +'s discussion 'Ghar Se Hum Ghar Talak Gaye Honge, Apne Hee Aap Tak Gaye Honge',
2 hours ago
+ ! ! hคຖiค khคຖ ! ! ! + liked + M.Tariq Malik's discussion Free Download Solved MCQs of Pakistan Affairs - Everyday Science - Current Affairs For MCQs for CSS, NTS, FTS, ETEA, OTS, UTS, FPSC, PPSC, SPSC, PMS, PSC, KPKPSC, AJKPSC, SOPE Exam
2 hours ago
+ ! ! hคຖiค khคຖ ! ! ! + liked + ! ! hคຖiค khคຖ ! ! ! +'s discussion 'Ghar Se Hum Ghar Talak Gaye Honge, Apne Hee Aap Tak Gaye Honge',
2 hours ago
+ ! ! hคຖiค khคຖ ! ! ! + posted a discussion
2 hours ago
VU AHMED replied to + M.Tariq Malik's discussion PHY301 Fall 2017 Final Term Papers Pattern & Questions 17 Feb 2018 to 28 Feb 2018 & Helping Material in the group PHY301 Circuit Theory
2 hours ago
+ ! ! hคຖiค khคຖ ! ! ! + updated their profile
3 hours ago
+ M.Tariq Malik liked + + + + " Tw!nkle "'s discussion Happy HAppy birthday !! FIYA
4 hours ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion EDU410 Teaching of Literacy Skills Assignment 01 Fall 2020 Solution / Discussion in the group EDU410 Teaching of Literacy Skills
4 hours ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion EDU410 Teaching of Literacy Skills Assignment 01 Fall 2020 Solution / Discussion in the group EDU410 Teaching of Literacy Skills
5 hours ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion EDU410 Teaching of Literacy Skills Assignment 01 Fall 2020 Solution / Discussion
5 hours ago
+ M.Tariq Malik added a discussion to the group EDU410 Teaching of Literacy Skills
5 hours ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion BIF401 Bioinformatics I GDB Fall 2020 Solution / Discussion in the group BIF401 Bioinformatics I
5 hours ago

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.