Quantcast

Maximum PC

It is currently Wed Dec 24, 2014 10:33 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: I've never done this before... weird way to run java program
PostPosted: Mon Oct 05, 2009 7:35 pm 
8086
8086

Joined: Thu Jul 08, 2004 6:46 am
Posts: 73
Hi, I'm currently working on a java program for my class and am needing some information. I've been coding in java fro about 2 years now and am totally stumped right now. Normally I write a program in a Program.java file, then compile it (javac Program.java) and then run it (java Program). Sometimes I require command line arguments, which is just (java Program filename).

The program I'm writing right now is slightly different. The instructor says:
Quote:
The command line usage for your program should look exactly as follows:

login_name filename

where filename is the name of a file that contains the definition of the grocery packing problem.


Is there some way to make a program recognize that "login_name" is the same as "java Program"???

I assume... even though I shouldn't... that he will have a directory containing all the students programs, and I may have to rewrite my program so that everything is in 1 file, because right now it's broken up into 5 or 6, and rename that file as login_name, then compile it and submit the .class file, but that's a huge assumption. and even if that's true, is there a way for you program to recognize that if it's called by its name (login_name) that it does java login_name. Im so confused.

Please help, I can't find anything on such things in any of my java resources.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Oct 05, 2009 9:35 pm 
Java Junkie
Java Junkie
User avatar

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24238
Location: Granite Heaven
Why don't you ask your prof? We can't tell you what he wants, after all, and the implementation of the program depends entirely on how he intends to run it.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Nov 11, 2009 12:34 am 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
Just out of curiousity, what did the prof want you to do with this one?

My hunch is that you were supposed to accept both login_name and file as input, then he was going to use a batch program that called all of the students code (ideally, running them through a series of unit tests).

Anyways, just a hunch.

HEYA JIPSTYLE! How are things up North?


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

© 2014 Future US, Inc. All rights reserved.