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

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

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

Looking For Something at Site? Search Below

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: 21720

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

Latest Activity

Mani Siddiqui Ex posted a discussion
12 minutes ago
Profile Iconsam faisal, Heena Muneer, daniyal ahmed and 19 more joined Virtual University of Pakistan
48 minutes ago
Mani Siddiqui Ex posted a status
""_عورت بیوی ہو, بہن ہو, دوست ہو یا بیٹی اس میں ماں جیسا خیال رکھنے کی خصوصیات ہوتی ہیں_""
1 hour ago
Tasha Malik posted a status
"Eng301 GDB 1, complete and accurate idea solution https://youtu.be/NMckVig0OVs"
1 hour ago
+M.Tariq Malik replied to Fragrance of Islam's discussion ENG301 Business Communication GDB No 01 Fall 2020 Solution / Discussion in the group ENG301 Business Communication
10 hours ago
+!!! ❤️ Shadow Girl❤️!!! replied to Miss. Churhail's discussion $$$$$AB YE SOCHA HY K HAM HAD SE GUZAR JAYEN GY$$$$$$
10 hours ago
maha replied to +M.Tariq Malik's discussion Mid Term Quiz Will Be Conducted Instead Of Mid Term Examinations - Fall 2020 Semester
10 hours ago
+!!! ❤️ Shadow Girl❤️!!! liked Miss. Churhail's discussion $$$$$AB YE SOCHA HY K HAM HAD SE GUZAR JAYEN GY$$$$$$
10 hours ago
maha replied to +M.Tariq Malik's discussion Mid Term Quiz Will Be Conducted Instead Of Mid Term Examinations - Fall 2020 Semester
10 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion FIN630 GDB No 01 Fall 2020 Solution / Discussion Last Date: 27-11-2020 in the group FIN630 Investment Analysis & Portfolio Management
10 hours ago
Aasma kiran commented on +M.Tariq Malik's group ENG301 Business Communication
10 hours ago
Aasma kiran joined +M.Tariq Malik's group
10 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion CS602 Computer Graphics Assignment 01 Fall 2020 Solution / Discussion Due Date: 04-12-2020 in the group CS602 Computer Graphics
10 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion CS602 Computer Graphics Assignment 01 Fall 2020 Solution / Discussion Due Date: 04-12-2020 in the group CS602 Computer Graphics
10 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion CS602 Computer Graphics Assignment 01 Fall 2020 Solution / Discussion Due Date: 04-12-2020 in the group CS602 Computer Graphics
10 hours ago
Rabbani King updated their profile
11 hours ago

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

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

.