Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
Instructions
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit if:
o The assignment is submitted after due date.
o The submitted assignment does not open or file corrupt.
o The assignment is full or partially copied from (other student or ditto copy from handouts or internet).
o Student ID is not mentioned in the assignment File or name of file is other than student ID.
o The assignment is not submitted .java format.

Uploading instructions
Your submission must include:

1. All the source code (.java files) and other if necessary files to compile and run your program.
2. If and only if there are multiple files to submit, place all the files in a Zip file and Upload it on VULMS else only source code file is required to be submitted.

Note: Use Notepad or Notepad++ for coding and JDK package for java source code compilation and running (A video tutorial of JDK installation and configuration is given in course download section)
Objective
The objective of this assignment is

o To give you some practice exercise of file handling and understanding use of it in java console programs.

Important Requirements and Instructions:
1. You are not allowed to use any IDE tool like Netbeans in this assignment.
2. Use text file (students.txt) attached with assignment file. Your code should work with given attached text file.
3. Use text file and java files in same directory.
4. Create Student.java which will contain student information (name, roll number, class, phone number and program).
5. Create Driver.java file which will read data from text file and show in tabular form (see output screen shot).
6. Complete all requirements given in output screen shot.
7. Assignment due date is November 08, 2012. Extra grace day (November 09, 2012) is only if last date has any problem (like server gets down or files not uploading). Any lame excuses will not be accepted after due date.
8. We will not accept assignment through email in any case. Be Careful



Question:
You have to develop a simple console base application, which reads the students records from “students.txt” file and displays each student’s information in form of table. The program should also count and display the number of alphabets, spaces, integers, words, characters and lines from the file in tabular form



Hints:
To manage student information use Student class.
To store multiple students record use ArrayList.
Posted
Updated 4-Nov-12 20:52pm
v2

Then you had best knuckle down and get on with it, hadn't you?


We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you find a specific problem, feel free to ask, but we don't just sit here giving you a passing grade.
 
Share this answer
 
Comments
ZulqarnainVU 6-Nov-12 12:17pm    
Thanks for guiding me but this is not the true solution of the problem.
OriginalGriff 6-Nov-12 12:23pm    
Oh it is, trust me on this.
Maybe not the solution you wanted, but it is the solution.
ZulqarnainVU 7-Nov-12 11:51am    
Thank you very much no doubt abut your saying that no one can learn how to program if does at his own. Thanx
It should be clear that your assignment will not get any credit if:
o The assignment is submitted after due date.
o The submitted assignment does not open or file corrupt.
o The assignment is full or partially copied from (other student or ditto copy from handouts or internet).
o Student ID is not mentioned in the assignment File or name of file is other than student ID.
o The assignment is not submitted .java format.

What makes you think your professor is not reading this right now?
 
Share this answer
 
Comments
ZulqarnainVU 6-Nov-12 12:20pm    
thanks but it is not helpful and he is not seeing this activity actually this is first assignment which has to be submitted correctly anyhow if you do not want to help then thank you very much sir.
Richard MacCutchan 6-Nov-12 12:39pm    
It is not supposed to be helpful, it is supposed to point you in the direction of at least trying to do your own work. If you cannot be bothered even to do some basic reading to find out how to do the simple parts of this assignment, then do not be surprised that we are not prepared to do it for you.

I suggest you start with The Java Tutorials, where you will find all the information you need to complete this assignment.
STEP 1. Read students.txt
STEP 1.1 from file into a DataTable
You need read line by line, then use string.Split function to split each line into array of tokens (corresponding to each column)[^]
To add rows to a DataTable - follow this example from MSDN[^]

STEP 1.2 from file into a simple string (for counting purpose)

STEP 2. Bind DataTable to a "DataGrid" (Start with a simple Winform project)
Again, follow this simple example![^]
But basically, just do this:
<br />
dataGrid1.DataSource = MyDataTable.DefaultView;<br />


STEP 3. Count alphabets/words/spaces/line breaks - you can use Regular Expression[^]

If you can't do this, you might as well switch major to something else.
 
Share this answer
 
Comments
ZulqarnainVU 6-Nov-12 12:18pm    
Thanks but here we can not use eclipse or netbeans.
devvvy 6-Nov-12 20:34pm    
dude i didn't recommend using Eclipse 99% .NET developer used Visual Studio I have no idea why use Eclipse and it's such a simple assignment

Why don't you just quit school
Richard MacCutchan 6-Nov-12 12:46pm    
For a Java console based assignment?
if you want to do it fast:

Note: Use Notepad or Notepad++ for coding and JDK package for java source code compilation and running (A video tutorial of JDK installation and configuration is given in course download section)
Objective
The objective of this assignment is


Use Eclipse or Netbeans. Both are free aqnd will guide you through the process. It will also speed up your development.
 
Share this answer
 
Comments
ZulqarnainVU 6-Nov-12 12:21pm    
Here we can not use eclipse or any other IDE how ever it is easy for you but for me it is firs experience and I have no idea for this?
TorstenH. 6-Nov-12 12:48pm    
You can't? Isn't this a home work that you do at home?

Anyway. We do not provide ready made home works. You can ask us about certain things or when you get stuck.
But please always provide code to show us your effort.
Check out devvvy's answer. In STEP2 he's referring to a GUI, please discard that. You only need a console output.

You can find example codes for every step in the web, but please try to do it yourself and not to cheat too much.
It will help you to write the code yourself. Also is it visible when a code comes from another person.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900