Server file input?

Reply

Join Date: Nov 2007
Posts: 10
Reputation: Cosmocrazy is an unknown quantity at this point 
Solved Threads: 0
Cosmocrazy Cosmocrazy is offline Offline
Newbie Poster

Server file input?

 
0
  #1
Oct 4th, 2008
I don't think this qualifies as cheating on homework.

I am making a Java applet that will input the name of a teacher at our school and output their schedule. When I say schedule, I mean the times they teach and what classes they teach, and where they teach them. I wanted to have 2 classes: a Teacher class and a Course class. Ideally, I'd like to store two giant CSV files on the server alongside the class files that I would be able to import into the applet to make a giant array/arraylist of Courses and Teachers rather than say, hard coding the array into the applet.

This is how I planned to make my constructors:
  1. public class Teacher{
  2. public Teacher(String sLastName, String sFirstName, int nBlock1, int nBlock2,...int nBlock8){
  3. }
  4. }
  5.  
  6. public class Course{
  7. public Course(int nCourseNumber, String sName, boolean bLong){
  8. }
  9. }

I don't know how to do file input/output though. Everything I see on Google is for client file input, but all I want to do is import some data from the server. How do I do this?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 29
Reputation: letlet_pogs has a little shameless behaviour in the past 
Solved Threads: 1
letlet_pogs letlet_pogs is offline Offline
Light Poster

Re: Server file input?

 
-1
  #2
Oct 4th, 2008
Originally Posted by Cosmocrazy View Post
I don't think this qualifies as cheating on homework.

I am making a Java applet that will input the name of a teacher at our school and output their schedule. When I say schedule, I mean the times they teach and what classes they teach, and where they teach them. I wanted to have 2 classes: a Teacher class and a Course class. Ideally, I'd like to store two giant CSV files on the server alongside the class files that I would be able to import into the applet to make a giant array/arraylist of Courses and Teachers rather than say, hard coding the array into the applet.

This is how I planned to make my constructors:
  1. public class Teacher{
  2. public Teacher(String sLastName, String sFirstName, int nBlock1, int nBlock2,...int nBlock8){
  3. }
  4. }
  5.  
  6. public class Course{
  7. public Course(int nCourseNumber, String sName, boolean bLong){
  8. }
  9. }

I don't know how to do file input/output though. Everything I see on Google is for client file input, but all I want to do is import some data from the server. How do I do this?


i think you dont have to do two class,,one class is enough..

public class Schedule{
public static void main (String args[]){

}

public static String Teacher ((String sLastName, String sFirstName, int nBlock1, int nBlock2,...int nBlock8){


return;

}


public static String Course(int nCourseNumber, String sName, boolean bLong){


}

return;



}


if you do it like this,,your main method will just call those methods,,,but it is still up to you..
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,438
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 510
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Server file input?

 
0
  #3
Oct 5th, 2008
Originally Posted by letlet_pogs View Post
i think you dont have to do two class,,one class is enough..

public class Schedule{
public static void main (String args[]){

}

public static String Teacher ((String sLastName, String sFirstName, int nBlock1, int nBlock2,...int nBlock8){


return;

}


public static String Course(int nCourseNumber, String sName, boolean bLong){


}

return;



}


if you do it like this,,your main method will just call those methods,,,but it is still up to you..
That is probably the worst suggestion you could make for this. Separate classes is appropriate design for this. Just because Java will let you create a procedural program by stuffing everything into static methods and variables doesn't mean it's the correct way to use the language.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC