The Artima Developer Community
Sponsored Link

Java Answers Forum
1st year degree assignment need help???

1 reply on 1 page. Most recent reply: Apr 1, 2002 4:29 AM by Sean

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Sean

Posts: 2
Nickname: seanuk
Registered: Mar, 2002

1st year degree assignment need help??? Posted: Mar 31, 2002 3:38 PM
Reply to this message Reply
Advertisement
Any ideas, need to write the following Java program
to find Billy Jones for example assuming that a txt file containings the following fields in no particular order:
StudentName,Cwk grade, exam grade

Billy Jones
50
60
Mary Jane
80
90

Email any Responces to seandoliver@hotmail.com thanks


Sean

Posts: 2
Nickname: seanuk
Registered: Mar, 2002

Re: 1st year degree assignment need help??? Posted: Apr 1, 2002 4:29 AM
Reply to this message Reply
import java.io.*;
public class findstudent
{
public static void main(String[] args) throws IOException
{


String name;
int exam;
int cwk;

BufferedReader in =new BufferedReader(new FileReader("marks.dat"));
boolean finished=false;
while(!finished)
{

BufferedReader keyin =new BufferedReader(new InputStreamReader(System.in));
name = keyin.readLine();

{


name =in.readLine();
finished=(name==null);
if (!finished)
{
cwk =Integer.parse(in.readLine());
exam = Integer.parse(in.readLine());
//tries to print record as an object
System.out.println(new Student(name,exam,cwk));






}
}
}
}
}

Flat View: This topic has 1 reply on 1 page
Topic: Methodical Dilemma Previous Topic   Next Topic Topic: to Mr Jay Kandy

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use