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

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

+ !! Ήලᵯᵯℹ Ⲥⱨ !! + posted discussions
2 minutes ago
Agha Danial Durrani joined + M.Tariq Malik's group
4 minutes ago
OWAIS AFSRA liked + M.Tariq Malik's discussion CS201 Introduction to Programming Assignment No 02 Fall 2020 Solution / Discussion Due Date: 18-12-2020
14 minutes ago
OWAIS AFSRA liked + M.Tariq Malik's discussion CS201 Introduction to Programming Assignment No 02 Fall 2020 Solution / Discussion Due Date: 18-12-2020
14 minutes ago
Arooj liked + M.Tariq Malik's video
28 minutes ago
Arooj liked + ⵑⵑ ӍᎥŞŞ ⲤһᵘʳһშᎥⵏ ⵑⵑ +'s discussion Us K Baad Aap Corona Se To Shayad Bach Jayen par shayed !!! hasna mana hy ;););)
1 hour ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion CS610 Assignment No 03 Fall 2020 Solution & Discussion in the group CS610 Computer Network
1 hour ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion STA301 Statistics and Probability Assignment No 03 Fall 2020 Solution & Discussion in the group STA301 Statistics and Probability
2 hours ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion STA301 Statistics and Probability Assignment No 03 Fall 2020 Solution & Discussion
2 hours ago
+ M.Tariq Malik added a discussion to the group STA301 Statistics and Probability
2 hours ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MCM601 Assignment No 02 Fall 2020 Solution / Discussion in the group MCM601 Media Management
2 hours ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion MCM601 Assignment No 02 Fall 2020 Solution / Discussion
2 hours ago

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

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

.