Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-17-2008, 08:05 PM
Member
 
Join Date: Feb 2008
Posts: 1
xtianah77 is on a distinguished road
Java assignment
Will like to know if anyone can assist me with this assignment. I just started the class, and i need help in completing this assignment.

Assignment:

The first programming project involves writing a program that determines whether a file of student records is in sorted order or not. This program should consist of two classes.

The first class should contain a main method that prompts the user for the name of the input file. If the input file cannot be opened, the method should continue to reprompt the user for the correct name, until the file can be opened. The file should be read, and the method should verify that the file is in ascending order. If it is not, an appropriate error message should be displayed, and the program should terminate. As the student records are read in, they should be displayed on the screen.

The second class should be named Student and should implement the predefined interface Comparable. Its instance variables should include first name, last name, an integer number of credits completed, and a floating-point grade-point average. This class should contain the following methods:

? A method input that reads in a student record from a file. All the data fields will be separated by at least one space. The order of the fields is first name, last name, credits, and grade point.

? A method output that writes out a student record to the screen. The name should be output last name first, separating the last and first names with a comma.

? A method compareTo that compares two student records. The names only are compared. The last name is more significant than the first. The method returns a ?1 if the first name is less than the second, a 0 if they are equal, and a 1 if the first name is greater than the second.

? A method equals that compares two students. Only the names are compared as with the compareTo method.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-18-2008, 12:54 AM
CaptainMorgan's Avatar
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 840
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
Welcome to the Forums xtianah.

A general rule of thumb around here is that we do not do your homework for you. If you're just starting out, then I recommend reading your assigned textbook. If you can't own a textbook, then I suggest you read Sun's tutorials. Otherwise, if you have at least some clue as to how to program- everything you need to do is in your assignment description, so what exactly is the problem? Your description even goes so far as to tell you the names of methods, names of the class, the interface it may implement and what parameters methods take and what they output. Every step is outlined for you.

You need to make an attempt at your work before you get help - Help yourself before we help you.

Considering you're new to the forum you may not have realized this isn't a do-your-homework-for-you-site, regardless you have not started off on the right foot. Read the FAQ before you post again.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums!
(closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
!
Got a little Capt'n in you? (drink responsibly)
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java assignment - couple methods don't know how to figure out Snowboardmylife New To Java 1 04-16-2008 11:52 AM
Please help... assignment for school confused2000 New To Java 3 11-12-2007 09:12 AM
for Assignment plz help assamhammad New To Java 1 11-06-2007 09:35 PM
java assignment, need help bad. carlos123 New To Java 1 11-06-2007 05:53 PM
Help with my assignment java toby New To Java 1 08-07-2007 06:59 AM


All times are GMT +3. The time now is 11:48 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org