Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 06-26-2009, 07:03 PM PM User | #1 SarahH New to the CF scene   Join Date: Jun 2009 Posts: 1 Thanks: 0 Thanked 0 Times in 0 Posts please help me really stuck Hello All, please could you help me as I am pulling my hair out with this one please could you look at my code and see where I am going wrong I am trying to write a program with the following :- create an Array called fibArray which generates the first 20 fibonacci numbers Then it should calculate the ratio by dividing each element of the first Array with the one before it and store these values in a second parrallel array called ratioArray It should then find the first value of ratioArray that is closer to the golden ratio than 0.001m byt. 1.61803399 will be used as the value for the golden ratio. finally it should display output in browser. This is what I have currently:- Please can someone help I have been trying to do this every night this week and am loosing hope that I will ever learn this language. Any help will be greatly appreciated. Thankyou in advance Sarah
 06-26-2009, 07:15 PM PM User | #2 Philip M Supreme Master coder!     Join Date: Jun 2002 Location: London, England Posts: 17,478 Thanks: 200 Thanked 2,470 Times in 2,448 Posts A good deal of the trouble is that your array is var fibArray = new Array (); but you refer to it in several places as myfibArray for (i = 0, j = 0; i < myfibArray.length; i++, j++) is not valid. You must write a nested loop as for (var i = 0; i "); // but where does the value 1.5 come in??? } } [I]var calculation = (myfibArray[i], ' - ', myfibArray / 2, '
') sequence.push(calculation); No idea what this is supposed to do. You cannot combine a mathematical calculation with a string. You need to have a look at order of precedence of operations and use of brackets. 6-4/2 = 4 but (6-4)/2 = 1 Do please read the posting guidelines regarding silly thread titles. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose. Why not edit it to something meaningful such as Fibonacci Numbers And Golden Ratio. All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit. Last edited by Philip M; 06-26-2009 at 08:07 PM..

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 03:42 AM.