...

View Full Version : im clueless!



ecntrc
07-15-2003, 05:40 AM
well, i know that i should do the coding myself. But see ive done it and it dont work and i simply dont understand javascript but i have to do something for JS class, so please if anyone would help me it would be greatly appreciated.. i have to create a conversion table using C=(F-32)/1.8 I have to start with a farenheit of 20 degrees and end with a temperature of 120 degrees using 3 degrees increments. now there should be a tble with 2 columns, one for farenheit and one for celcius. i know that there has to be a loop and a while function in there and document.write. im just fustrated already...please somebody help me im not asking you to fully write it out (although that would be the bomb) but it dosent work that way, so if somebody is kind enough to talk to me and reallly seriously help me understand and help me write this code i will love you for life. aim:e3ccentric aloha:thumbsup:

WA
07-15-2003, 06:30 AM
Hi:
Firstly, please read our posting guidelines regarding using a descriptive subject for your thread: http://www.codingforums.com/postguide.htm

Regarding your question, it would greatly help if you post what you have so far, so several reasons, one of them to show you've actually made an attempt on the project yourself. We can't help people write their assignments- that is cheating.

ecntrc
07-15-2003, 07:14 AM
i wasnt asking someone to do my assignment first of all, second of all i was ASKING for help on understanding JS and anyone that would be able to seriously help me with this. again i wasnt asking someone to do my homework thank you very much..

tommysphone
07-15-2003, 12:09 PM
Hi there.

I took the liberty of searching on google for you.

Here are some links to actual converters for you. take a look, see what they do and how.

http://www.albireo.ch/temperatureconverter

http://www.temperatureworld.com/tempcon.htm

http://www.allmeasures.com/temperature.html

I hope this helps you. there where loads more results but I liked these. Good luck with the assignment.

ecntrc
07-16-2003, 02:05 AM
thanks i will check those out right now, and i think i wont be using this service anymore, they think im asking someone to do my homework which im not, so im not even going to attempt to post the codde ive done with this project take care and god bless
alojahz

jalarie
07-16-2003, 03:29 PM
First an EXAMPLE (not your homework) script:

&nbsp;&nbsp;01:&nbsp;Out&nbsp;='<table&nbsp;border="1"&nbsp;cellspacing="2"&nbsp;cellpadding="2">\n';
&nbsp;&nbsp;02:&nbsp;&nbsp;&nbsp;document.write(Out);
&nbsp;&nbsp;03:&nbsp;Out&nbsp;='&nbsp;&nbsp;<thead>\n';
&nbsp;&nbsp;04:&nbsp;Out+='&nbsp;&nbsp;&nbsp;&nbsp;<tr>\n';
&nbsp;&nbsp;05:&nbsp;Out+='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<th&nbsp;bgcolor="#ffffcc">Column&nbsp;1<\/th>\n';
&nbsp;&nbsp;06:&nbsp;Out+='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<th&nbsp;bgcolor="#ffffcc">Column&nbsp;2<\/th>\n';
&nbsp;&nbsp;07:&nbsp;Out+='&nbsp;&nbsp;&nbsp;&nbsp;<\/tr>\n';
&nbsp;&nbsp;08:&nbsp;Out+='&nbsp;&nbsp;<\/thead>\n';
&nbsp;&nbsp;09:&nbsp;&nbsp;&nbsp;document.write(Out);
&nbsp;&nbsp;10:&nbsp;Out&nbsp;='&nbsp;&nbsp;<tbody>\n';
&nbsp;&nbsp;11:&nbsp;&nbsp;&nbsp;document.write(Out);
&nbsp;&nbsp;12:&nbsp;for&nbsp;(ix1=4;&nbsp;ix1<100;&nbsp;ix1+=7)&nbsp;{
&nbsp;&nbsp;13:&nbsp;&nbsp;&nbsp;ix2=(ix1+10)/3;
&nbsp;&nbsp;14:&nbsp;&nbsp;&nbsp;Out&nbsp;='&nbsp;&nbsp;&nbsp;&nbsp;<tr>\n';
&nbsp;&nbsp;15:&nbsp;&nbsp;&nbsp;Out+='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<td&nbsp;bgcolor="aqua"&nbsp;align="right">'+ix1+'<\/td>\n';
&nbsp;&nbsp;16:&nbsp;&nbsp;&nbsp;Out+='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<td&nbsp;bgcolor="aqua"&nbsp;align="right">'+ix2+'<\/td>\n';
&nbsp;&nbsp;17:&nbsp;&nbsp;&nbsp;Out+='&nbsp;&nbsp;&nbsp;&nbsp;<\/tr>\n';
&nbsp;&nbsp;18:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.write(Out);
&nbsp;&nbsp;19:&nbsp;}
&nbsp;&nbsp;20:&nbsp;Out&nbsp;='&nbsp;&nbsp;<\/tbody>\n';
&nbsp;&nbsp;21:&nbsp;Out+='<\/table>\n';
&nbsp;&nbsp;22:&nbsp;&nbsp;&nbsp;document.write(Out);

Then a line-by-line explaination of things I think might be significant:

&nbsp;01: 'Out' is a variable that I'm using to build an output set of lines. It now contains the main 'table' line. The backslash-n near the end of the line causes a new-line in the view-source listing and makes it look nice.
&nbsp;02: This puts 'Out' to the web page.
&nbsp;03-09: Build the table header and put it on the page. The indents and backslah-n's are there to make the view-source look nice.
&nbsp;10-11: Put out the table-body line.
&nbsp;12: Begin a 'for' loop that starts with ix1=4, continues as long as ix1 is less than 100, and increments ix1 by 7 each time. You could also use a 'while' loop. Obviously, you'll have to change parameters to match your assignment.
&nbsp;13: Calculates a second value based on the loop parameter.
&nbsp;14-18: Build a row of the table. Notice the 'ix1' and 'ix2' items that are NOT within the quoted strings; these pick up the values.
&nbsp;20-22: Finish the table.

joeframbach
07-16-2003, 05:29 PM
who is they? WA? well. he's an admin, its his job to correct the people with posts<=15.:rolleyes:

don't leave the forums. they are a great place to learn and get HELP.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum