By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,643 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,643 IT Pros & Developers. It's quick & easy.

Logic Development in terms of Java

P: 24
Hi Guys....
I have been learning java for some time now(3 months)...I have very good mathematics, solving puzzles & all kind of things...
I have been excellent in academics and have very good analytical skills...I have nearly photographic memory(My IQ is 187)...
But developing logic for something that java will understand is like beyond my scope...
In colleges my friends would tell me that i make them look like chimps...
But now learning java I feel like i am a chimp...even my friends who struggle doing basic maths and reasoning develop better programs than me...

My concepts in java are strong because i know what every keyword or method does in java.. but give me a program to write i struggle with what variables to use where.. should i use for-loop or others...

eg Student exam (off-line) project
Now i have to put questions(with options) from a notepad file to database & display it on screen using swing...
I did every functions but I could not develop a logic to make questions from notepad to database to screen...

I do not expect a solution from you people...but a push in the right direction towards my goal to become a good programmer....Help me out guys...I have never felt so helpless before....
Feb 10 '13 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 10K+
P: 12,421
The first step would be to write out in words how you would accomplish this task.

For example, in this case, one approach would be:

1) Read one line from the notepad file.
2) Insert that line into the database.
3) Display the line to the screen.
4) Go back to line 1 and repeat until the entire file has been read.

That is the basic logic.
Feb 10 '13 #2

P: 24
Thanks a lot Mr.Rabbit...I already got that part... I also attempted using split method by putting symbols at the end of each sentence...But as i said i do not struggle here i struggle in the next step....
How to put my thinking in codes??

This thing happens every time...I have a fair idea on how to do the task(java) but not how to put it in codes??
This is freaking me out.
Feb 11 '13 #3

Expert Mod 10K+
P: 12,421
If you're still having problem, you need to write more and more detailed steps until you can translate it to code by mapping functions to the steps.

For example, step 1 from above can be written in more detail as:
1a) Open the file
2a) Read a line from the file

At this point, I can look for functions that does each of these steps. 1a can be accomplished with the Scanner class and 1b can be accomplished with the nextLine method of the Scanner class.

And then you tackle the next step. Write more and more specific instructions until you can map them to functions.
Feb 11 '13 #4

Post your reply

Sign in to post your reply or Sign up for a free account.