Type: Posts; User: Norm
Search took 0.09 seconds.
April 3rd, 2014, 03:40 PM
March 21st, 2014, 10:29 AM
What variable has the null value? Look at the error message for the line number for where the error happens, then look at the line and find the variable, then backtrack in the code to find out why...
March 17th, 2014, 03:39 PM
Are you saying that there is no problems with reading and displaying the contents of a file?
The problem is with the program's logic: when a read and display request is made, it is done two times.
March 17th, 2014, 02:11 PM
Is the problem with reading and displaying the contents of a file?
March 17th, 2014, 05:27 AM
I don' think the try blocks would cause the problem that you describe.
Can you post a short sample session with a user? Something like this:
Ask the questions
user enters 1
do work for 1
March 16th, 2014, 09:13 PM
These lines are still outside of the loop:
// readFile r = new readFile();
System.out.println("Please enter:\n 1 to add a business contact\n 2 to add a personal conatact"
March 16th, 2014, 08:56 PM
Why have a while loop if it will only execute once? Why not use an if statement?
March 16th, 2014, 08:29 PM
Why are there 2 while loops?
How does the code exit the 2nd loop if the control variable's value isn't changed?
March 16th, 2014, 08:08 PM
You haven't changed the code as I suggested.
March 16th, 2014, 07:45 PM
Then back to one loop with the questions inside and at the top of the loop.
March 16th, 2014, 07:22 PM
How can the initial display show option 3 if there are not any contacts entered yet?
Is the design shown in post#49 wrong?
Can there be an intermixing of adding contacts and showing contacts?
March 16th, 2014, 06:44 PM
What did you change?
The question is still OUTSIDE of the loop?
There are more questions inside of the loop.
I thought there were to be two loops:
// First loop to process input and save it...
March 16th, 2014, 05:50 PM
Post#45 suggested there be two loops:
1) to get the data
2) to display the data
March 16th, 2014, 05:24 PM
Ok what is the problem coding that?
Put 1) inside a loop that continues until ALL contracts are entered
Then do 2)
March 16th, 2014, 05:13 PM
Are you asking about:
Where the question should be asked
vs what question to ask?
What question to ask and what responses to allow depend on the state of the data. Boolean variables can be...
March 16th, 2014, 05:00 PM
Did you miss my last post? I still see the question and answer OUTSIDE the loop.
And the question/answer groups are in more than one place instead of in ONE PLACE at the top of the loop. See...
March 16th, 2014, 04:41 PM
First thing I see is that the asking of the question and the reading of the response are before the while loop not INSIDE the loop.
The next thing is that the question is asked in many places NOT...
March 16th, 2014, 04:30 PM
My idea was to have ONE while loop. That was what I meant when I said:
that was THE ONE while loop
March 16th, 2014, 03:57 PM
Something like this:
do what was requested << this would be handled by switch or chain of if/else if statements
March 15th, 2014, 08:04 PM
There should be only one loop enclosing the asking of user choice and the handling of his choice, not a loop for handling each choice.
March 14th, 2014, 06:44 AM
Does the code you posted compile OK? If there are errors, copy the full text and paste it there.
March 6th, 2014, 09:13 AM
The arraylist that holds Business class objects should not be inside of the Business class. The arraylist needs to be in a class where the methods that create Business class objects can get to it so...
March 6th, 2014, 08:15 AM
How does the program get the data that goes into a Business class object?
When does the program create a Business class object using that data?
When does the program put that newly created Business...
March 6th, 2014, 06:57 AM
The Main class could contain the arraylist of Business objects.
Somewhere there could be a method that gets the data to go in the Business class object, create the Business class object and store...
March 5th, 2014, 07:58 PM
The arraylist of Business objects should be somewhere that it is accessible to whatever classes and methods need to have access.
Somewhere the code should gather the data needed to build a...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.