This is a discussion on "Please help a javascript idiot" within the JavaScript Forum section. This forum, and the thread "Please help a javascript idiot are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Please help a javascript idiot
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Could anyone help me amend this simple program.
I have to complete the following assignment ASAP and don't have a clue how: Create 3 parallel arrays to store 15 contacts names, addresses and phone numbers. Create a function to prompt the user for the contact details. Create a function to print the details. In the main part of the program the user is repeatedly asked whether they want to add a new contact or end the program. Add the necessary codes and call the functions as appropriate. This is what I managed to do so far:
I hope I made myself understood. i would really appreciate any suggestion Last edited by karinne; Jun 18th, 2007 at 13:39. Reason: Please use [code]...[/code] tags when displaying code! |
|
|
|
||||
|
Re: Please help a javascript idiot
Your problem is that the for loop is in the contacts function, it needs to be down to where you prompt "Do you want to add...". I myself don't have that much clue of javascript, but here's my (untested) version:
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
|||
|
Re: Please help a javascript idiot
Thank you so much c010depunkk.
Finally the program works fine, the only problem is that I'm not allowed to use the 'break statement' because this is something my tutor hasn't covered yet, so I need to find an alternative way to stop the program. THANK YOU AGAIN! |
|
||||
|
Re: Please help a javascript idiot
No problem. What kind of a course are you taking?
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
|||
|
Re: Please help a javascript idiot
Thank you for replying so quckly. I'm taking a javascript course for beginners covering only the very basic such as while, if and for loops, simple functions, simple arrays.
In this particular homework I need to use parallel arrays, 2 functions, and conditional statements. You are very kind |
![]() |
| Tags |
| beginner, javascript |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Idiot question about documents | kingwilliam | Starting Out | 2 | May 23rd, 2008 16:10 |
| Poll: Is Moojoo an Idiot? | moojoo | Webforumz Cafe | 44 | Jan 4th, 2007 20:33 |
| what does + + mean in Javascript eg: var m = (A1+ +B4); | Andy K | JavaScript Forum | 6 | Dec 13th, 2006 23:57 |
| Question about User loggins from an idiot | Webstuck | PHP Forum | 6 | Nov 27th, 2006 22:29 |
| Its the coding idiot =p | PHP_newb | Introduce Yourself | 6 | Jul 22nd, 2005 08:05 |