How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask R.R. Jha Your Own Question

R.R. Jha
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5470
Experience:  B.Tech
20870358
Type Your Homework Question Here...
R.R. Jha is online now
A new question is answered every 9 seconds

Hello, I am a computer sciences student and I am working on

Resolved Question:

Hello, I am a computer sciences student and I am working on my program that is due by this the end of this week on Friday. I was wondering if you could take a look at my program and help me finish it. It is an address book and is supposed to be able to create, delete, update, and read contacts (from a txt file) as well as search, & save them all to a text file (the array of contacts). Also, the contacts should be sorted in some fashion, like bubble sorted. Let me know if this is something you could look at & we'll go from there. (Note: I have quite a bit of it done already, so all it would be is to just make sure everything works and then complete a few parts).

Submitted: 1 year ago.
Category: Homework
Expert:  R.R. Jha replied 1 year ago.
Hi,
Welcome to JA!

I'd be glad to help. Please zip your project, upload it at wikisend.com and post download link here.


Thanks
Customer: replied 1 year ago.

Hello, I am trying to upload it wikisend and it isnt allowing me to upload an entire folder. Can I post the code below or email it to you?

Expert:  R.R. Jha replied 1 year ago.
Please zip the file, and try uploading the zip file at wikisend.com or mediafire.com.

We aren't allowed to share personal emails on this forum.
Customer: replied 1 year ago.

Ok, here it is:


 


http://wikisend.com/download/155336/program.java


 


That is the source code for the program.


 


 

Expert:  R.R. Jha replied 1 year ago.
Ok, received it. Let me know the functionality which you've already implemented and those which you would like me to work on.
Customer: replied 1 year ago.

Ok. So far, I have the create, read, and delete working pretty nicely.


 


I have the method for updating, and the code seems like it should work, but for some reason just isnt.


 


Also, I made a little interface for the console and my teacher would like us to stick to that. When on the interface, we're supposed to be able to enter 'n' to go to the next entry in the database and 'p' for the previous. I put the methods in the program for that, but they arnt working as well.


 


Finally, in the program the each contact's info is saved to one location on an array of contacts of the class "Contact". When the program starts, it should begin by reading the file and using those already, pre-existing contacts, in the program. The program should re save the contacts list into the text file from the list which it read from when the program opened. Also, the book should also be able to search contacts (I have the code for searching in the program already, and it works, but I believe that my teacher wants the contacts to be sorted (bubble sorted) by last and then first name.


 


The code should be at about a high school level and not too difficult or too advanced. Thank you, XXXXX XXXXX know if you have any clarifications you need to make.

Expert:  R.R. Jha replied 1 year ago.
Ok, got it. This may take some time. I'll work on this and get back to you tonight or tomorrow morning. Depending on time it takes, you might need to update the price a bit, which I'll let you know if so. I hope that's fine with you.
Customer: replied 1 year ago.

Hi, that sounds good. It would be great if it could be done by tomorrow around 12pm. Thank you very much, this has been a great experience so far on JA.

Expert:  R.R. Jha replied 1 year ago.
Ok, Thanks.
Customer: replied 1 year ago.

Hello, just a quick clarification. The language option I chose was JavaScript, because there was not option for java. The program does, however, have to be written in java and not javascript.

Expert:  R.R. Jha replied 1 year ago.
Yeah, got that.
Expert:  R.R. Jha replied 1 year ago.
Hi,

I'm almost finished with the program. Made some modifications to previously written methods and added a few more. You may review them and let me know. I hope you can add $20 more after rating the answer. Let me know. I'll post the answer soon.


Thanks
Customer: replied 1 year ago.

Hello RRJha, that sounds great. Will the program be in full working condition when you are finished? Yes, I wouldn't mind adding an extra $20 when we're all done and its all working. Thank you, XXXXX XXXXX you soon.

Customer: replied 1 year ago.

Oops! Didn't see it posted.

Expert:  R.R. Jha replied 1 year ago.
Yes, it's in full working condition. I've tested all user commands. Only that I'm saving only the first and last name to file. You may change that if you wish.

https://www.box.com/s/bv1wjrbx94cmvppnp3l9

Let me know if I could be of further help.

Please leave a rating for the answer.
Then you can use 'Add Bonus' option to add $20.

Just add 'RRJha' at the start of your new questions to send it directly to me.
Thanks
Customer: replied 1 year ago.

Hello RRJha, thank you very much. The program looks great and works a lot better! I went through it and I was wondering if you could make a few minor adjustments.


 


--the progam has problems reading from a file. Because the program only saves the first and last names to a file, when the program goes back into the file to read it, it only reads the first and last names of the contacts. When the user asks the program to show a contact, then only the first and last names are XXXXX XXXXX the rest of the fields are blank. Could you have all the fields saved and read?


 


-- for displaying contacts: remove the "list all contacts" command and then make a "show contacts" command instead. In this command make it show the first contact and then from there we would then have the option to go to a previous or next contact.


 


--when updating a contact, the program should just go to the save all data method, it should not have to ask to the user to save the data. However, it should ask if he or she wants to over write it.


 


--when searching a for a contact, the search shouldnt be case sensitive. If the contact was entered as "John Doe" and the user searched john doe, that contact should come up.


 


--for listing contacts, could you think of a more creative way to list them (i.e. include all their info somehow in a short way so that it doesnt take up too many lines). I think that might make the program just that much better!



Thank you, XXXXX XXXXX you soon.

Expert:  R.R. Jha replied 1 year ago.
Ok, updating it.
Customer: replied 1 year ago.

I made a couple of changes to it for a little head start: http://wikisend.com/download/605806/programv2.java

Expert:  R.R. Jha replied 1 year ago.
Ok
Expert:  R.R. Jha replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5470
Experience: B.Tech
R.R. Jha and 7 other Homework Specialists are ready to help you
Customer: replied 1 year ago.

Hello, that is absolutely amazing, I am very happy with the help! Just one last thing, do you think that it would be possible to implement this as a write to a file method and still be able to read from it?:


private static void WriteData() {
switch (DecideIfToWrite()) {
case 'y':
try {
File f = new File("stuff.txt");
if (!f.exists()) {
f.createNewFile();
}
FileWriter file = new FileWriter("stuff.txt");
BufferedWriter wbuff = new BufferedWriter(file);
wbuff.write("Current Contacts in the Address Book:");
for (int i = 0; i < ncontacts; i++) {
wbuff.newLine();
wbuff.write("Contact #: " + i + "\n");
wbuff.newLine();
wbuff.write("First Name: " + contactArray.getFirstName());
wbuff.newLine();
wbuff.write("Last Name : " + contactArray.getLastName());
wbuff.newLine();
wbuff.write("Address #1: " + contactArray.getAddress1());
wbuff.newLine();
wbuff.write("Address #2: " + contactArray.getAddress2());
wbuff.newLine();
wbuff.write("City : " + contactArray.getCity());
wbuff.newLine();
wbuff.write("Province : " + contactArray.getProvince());
wbuff.newLine();
wbuff.write("Postal : " + contactArray.getPostal());
wbuff.newLine();
wbuff.newLine();
}
wbuff.close();
} catch (IOException e) {
return;
}
System.out.println("All data was successfully written.\n");
case 'n':
}
}

Expert:  R.R. Jha replied 1 year ago.
Yes, it can be done. But then the read method would be much more complex than what currently is. So, I'd suggest that we stay with our current methods.
Customer: replied 1 year ago.

How much more complex? Do you think that it would make the program look a bit nicer? (or the file rather).

Expert:  R.R. Jha replied 1 year ago.
To be honest, I think current format is what the standard database file looks like. Because we already know the name and position of each field. All common fields are listed under one column, instead of each individual field carrying separate but redundant tag.
Customer: replied 1 year ago.

Ah I see, ok. I'm just going to do a bit more testing and then we should be done! Thank you for all of your help today, it has been much appreciated. Your service has been excellent and of very high quality. I will reply here if I have any further clarifications to make.

Expert:  R.R. Jha replied 1 year ago.
Thanks.
Please leave a rating for the answer when all done. Would look forward to bonus as well.

Thanks

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3458
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3124
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2385
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1988
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1876
    Bachelors Degree and CPA with Accounting work experience
  • http://ww2.justanswer.com/uploads/avremote/photoa.jpg Seanna's Avatar

    Seanna

    Tutor

    Satisfied Customers:

    1781
    3,000+ satisfied customers, all topics, A+ work
 
 
 
Chat Now With A Tutor
R.R. Jha
R.R. Jha
2564 Satisfied Customers
B.Tech