# Need Help with Javascript ASAP

**URL:** <https://forum.kirupa.com/t/need-help-with-javascript-asap/16850>\
**Category:** programming\
**Created:** [March 28, 2003, 11:56pm UTC](https://forum.kirupa.com/t/need-help-with-javascript-asap/16850 "2003-03-28T23:56:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devil](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Devil](https://forum.kirupa.com/u/Devil)\
**Post date:** [March 28, 2003, 11:56pm UTC](https://forum.kirupa.com/t/need-help-with-javascript-asap/16850/1 "2003-03-28T23:56:38Z")

</div>

need this as soon as possible  
two question that are to use javascript to solve the problem.

anyone with any input please -

1 Q - write a program to calculate 1.5% return on an investment of $10,000. calculate how many years it will take a single $10,000 investment to reach $1,000,000 at an average return of 1.5%. must use loops statement and assume that each iteration is equivalent to one yeays.

2 Q - use an appropriate looping statement to write a program that prints a list of the Celsius equivalent of zero degrees Fahrenhiet through 100 degrees Fahrenhiet. To convert F to C, please subtract 32 from F, and then multiply th remainder by 5.5. for converting C to F, multiply the c temperature by 1.8, and then add 32.

guys i realy realy need this as soon as possible.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 29, 2003, 1:34am UTC](https://forum.kirupa.com/t/need-help-with-javascript-asap/16850/2 "2003-03-29T01:34:46Z")

</div>

guys i realy need it as soon as possible…  
if any one of u have a clue let me know  
and please post a reply

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 29, 2003, 5:01am UTC](https://forum.kirupa.com/t/need-help-with-javascript-asap/16850/3 "2003-03-29T05:01:24Z")

</div>

For Problem number 2, the conversion of C to F, you can do this…

```php
<SCRIPT LANGUAGE="JavaScript">
<!--
//define array to store degrees
var degreeArray = [];
//first write the table tag
document.write("<TABLE WIDTH='100' BORDER='1'>");
//now define the first TR tag and the first TD tags which are the titles "C" and "F"
document.write("<TR><TD ALIGN='center'><B>C</B></TD><TD ALIGN='center'><B>F</B></TD></TR>")
//start for loop - "C" is the degrees celcius, if it is less then 101, then add 1 to it
for (var C=0; C<101; C++){
//create equation variable
var CtoF = Math.round((C*1.8)+32);
//store new value in degreeArray according to the place of "C"
degreeArray[C] = CtoF;
//drag more table
document.write("<TR><TD ALIGN='center'>");
//display C's value
document.write(C);
//draw more table
document.write("</TD><TD ALIGN='center'>");
//display the converted F value
document.write(degreeArray[C]);
//close out the cells
document.write("</TD></TR>");
}
//close out the table
document.write("</TABLE>");
-->
</SCRIPT>

```

For problem number one, wow man, thats just a pain in the arse and a lot to ask for. I could probably do it, but I don’t have the time to spend on it, problem 2 was easy so I didn’t mind that. Perhaps you jumped in over your head here, you really shouldn’t accept an assignment you can’t do otherwise this panic situation happens.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 29, 2003, 6:07am UTC](https://forum.kirupa.com/t/need-help-with-javascript-asap/16850/4 "2003-03-29T06:07:07Z")

</div>

Wait wait wait… I just re-read what you were doing for the temperature thing, and I think your equations are wrong.

How can

C to F be (C\*1.8)+32

But

F to C is (F-32)\*5.5

??

That makes no sense.

Well anyway, I fully commented your code, so edit it away for what you want to do, its the same thing, I just did C 0-100 instead of F 0-100, so you just gotta switch it up.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 8, 2003, 11:33pm UTC](https://forum.kirupa.com/t/need-help-with-javascript-asap/16850/5 "2003-04-08T23:33:19Z")

</div>

my bad luck it was a little too late…  
but that you for your help.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 9, 2003, 3:06am UTC](https://forum.kirupa.com/t/need-help-with-javascript-asap/16850/6 "2003-04-09T03:06:19Z")

</div>

Sorry :-\
