aspose file tools*
The moose likes Beginning Java and the fly likes How to Save data about 5 computers? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to Save data about 5 computers? " Watch "How to Save data about 5 computers? " New topic
Author

How to Save data about 5 computers?

Joe Davis
Greenhorn

Joined: Apr 02, 2012
Posts: 10
I have a course assignment but im stuck.

this is what I was told.

Use a text file. Save data about 5 computers: HDD size, model name, weight, and screen diagonal. Find a computer with the biggest diagonal.

Help please.
Manoj Kumar Jain
Ranch Hand

Joined: Aug 22, 2008
Posts: 191

What you have done ?

In starting just create a small program that creates a file and write your name in this file.
Later extend this program to have data as you required.

Thanks


Do not wait to strike till the iron is hot; but make it hot by striking....
Joe Davis
Greenhorn

Joined: Apr 02, 2012
Posts: 10
I just can't grasp java yet and this task is a little beyond me, could you write it for me, I could pay.

i paid alot for this course and i really dont want to fail.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9993
    
    7

Welcome to the Ranch.
What have you tried and where are you stuck?



[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9993
    
    7

Manoj Kumar Jain wrote:
In starting just create a small program that creates a file and write your name in this file.
Later extend this program to have data as you required.


I think the requirement indicates reading a file and analyzing the data.
Manoj Kumar Jain
Ranch Hand

Joined: Aug 22, 2008
Posts: 191

Maneesh Godbole wrote:
Manoj Kumar Jain wrote:
In starting just create a small program that creates a file and write your name in this file.
Later extend this program to have data as you required.


I think the requirement indicates reading a file and analyzing the data.


I think requirement is to save the data as mentioned in the subject line
How to Save data about 5 computers?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9993
    
    7

Joe Davis wrote:I just can't grasp java yet and this task is a little beyond me, could you write it for me, I could pay.
i paid alot for this course and i really dont want to fail.

The Ranch is NotACodeMill
If you wish to pay for someone else to write your code, there are other sites out there to facilitate this kind of thing.

A friendly tip:
Asking someone to write your code so you can pass is not really a good idea. Wouldn't you rather do it yourself? What will you do when you are stuck with a problem at your job? Pay someone to take care of it for you?
I would suggest, give it your best shot. In case you can't get it, show us your code, tell us what part you are having problems with, and we will pool in to point you in the right direction. Best of luck
Manoj Kumar Jain
Ranch Hand

Joined: Aug 22, 2008
Posts: 191

Joe Davis wrote:I just can't grasp java yet and this task is a little beyond me, could you write it for me, I could pay.

i paid alot for this course and i really dont want to fail.


Just try this is not very hard, you can do it and we all are here to help you.
If you have paid a lot for this course then make it worth by learning..
Joe Davis
Greenhorn

Joined: Apr 02, 2012
Posts: 10
Thank you for your replies.

I understand this isn't a codemil and i apologize for asking but I haven't had the time to learn Java as well as id hoped, i just don't have the time.
my mother currently has a spinal disease so she cant walk anywhere so I'm constantly looking after her but trying to stay on top of my assignments.
I just need this one little program so i can give myself more time to learn Java, I don't want to lose my money.

It's just really hard
Manoj Kumar Jain
Ranch Hand

Joined: Aug 22, 2008
Posts: 191

I am really very sorry to know about your problems, but this type of help is not going to help you actually, this will just make you more dependent.
This is not hard as it seems to be. You just start with it and soon you will find that you are about to complete it.
Joe Davis
Greenhorn

Joined: Apr 02, 2012
Posts: 10
I'm actually really self reliant, I just can't think at the minute. I have done my last 5 assignments which I could show you but I just need this little bit of help please.
I have to much on my mind at the minute and i have till tomorrow to complete this.

This was my first.


This is my most recent.

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

See Oracle's tutorials about I/O. It's also easy to find examples on the web of reading and writing text files in Java line by line.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Joe Davis
Greenhorn

Joined: Apr 02, 2012
Posts: 10
I don't hardly understand them concepts, I desperately need this, please can somebody just help me this once. I'll do anything..
Manoj Kumar Jain
Ranch Hand

Joined: Aug 22, 2008
Posts: 191

Hi,

I found one tutorial to write to text file, you can extend this code for your program.
Let us know if you face any problem.

http://www.roseindia.net/java/beginners/java-write-to-file.shtml

[Edit]
Search yourself to know how you can read the file once you are done with writing. Later you can write logic to find out the computer with maximum screen size.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Joe, please BeForthrightWhenCrossPostingToOtherSites <-- that's a link
http://www.java-forums.org/new-java/57750-how-save-data-about-5-computers.html

Any more?


luck, db
There are no new questions, but there may be new answers.
Joe Davis
Greenhorn

Joined: Apr 02, 2012
Posts: 10
It's okay, I'm going to try myself. Thanks for the help but I need to do this myself, I apologize for cross posting and begging.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Manoj Kumar Jain wrote:http://www.roseindia.net/java/beginners/java-write-to-file.shtml

Ugh. Roseindia sucks balls. Don't take their code and advice for anything but anti-patterns.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10925
    
  12

1) take a deep breath
2) slow down
3) relax
4) analyze your requirements, and break it apart. write the code a small piece at a time. Compile and test OFTEN - literally, every time you write 2-3 lines, recompile and fix any problems.

"Use a text file. Save data about 5 computers: HDD size, model name, weight, and screen diagonal. Find a computer with the biggest diagonal."

This has several pieces:

1) writing to a file
2) storing data on 5 computers
3) finding the diagonals
4) saving the largest number of a set
5) getting all the information on the computer with the largest diagonal.

So...why are you asking for username and passwords, if the specs don't ask for it? Don't make the project any more complicated than it needs to be.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Manoj Kumar Jain
Ranch Hand

Joined: Aug 22, 2008
Posts: 191

Tim Moores wrote:
Manoj Kumar Jain wrote:http://www.roseindia.net/java/beginners/java-write-to-file.shtml

Ugh. Roseindia sucks balls. Don't take their code and advice for anything but anti-patterns.


Whats wrong with roseindia ? If the post is useful then whats the harm to use it and start.

So...why are you asking for username and passwords, if the specs don't ask for it? Don't make the project any more complicated than it needs to be.

He is not asking for the user name and password in the current program, these are the some of the programs those he previously created..
Joe Davis
Greenhorn

Joined: Apr 02, 2012
Posts: 10
Manoj Kumar Jain wrote:
Tim Moores wrote:
Manoj Kumar Jain wrote:http://www.roseindia.net/java/beginners/java-write-to-file.shtml

Ugh. Roseindia sucks balls. Don't take their code and advice for anything but anti-patterns.


Whats wrong with roseindia ? If the post is useful then whats the harm to use it and start.

So...why are you asking for username and passwords, if the specs don't ask for it? Don't make the project any more complicated than it needs to be.

He is not asking for the user name and password in the current program, these are the some of the programs those he previously created..


Yes, they were some of my previous programs that have yet to be implemented.

Okay, I've got my head back on now, I hope I've nearly done this, it's pretty much just basic I/O, I think I got a little dazzled by the test.

Thanks for all the replies.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Manoj Kumar Jain wrote:
Tim Moores wrote:
Manoj Kumar Jain wrote:http://www.roseindia.net/java/beginners/java-write-to-file.shtml

Ugh. Roseindia sucks balls. Don't take their code and advice for anything but anti-patterns.


Whats wrong with roseindia ? If the post is useful then whats the harm to use it and start.


There are enough blatant errors there that it makes the site not even worth considering, especially in light of the fact that there are far better resources just as readily available.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Save data about 5 computers?
 
Similar Threads
How draw line between Labels on Canvas
data in bean
Magic Squares
Grid Routes
Turn Based Strategy Games