Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / December 2005

Tip: Looking for answers? Try searching our database.

temprature of water programe

Thread view: 
vicki - 09 Dec 2005 11:24 GMT
<HTML>
<HEAD>
<TITLE>// A program determining the state of water
</TITLE>
<SCRIPT LANGUAGE = "JavaScript">

// A program for determining the state of water
var theTemperature = 0;
theTemperature = window.prompt('What is the temperature?','');
if (theTemperature >= 0)  
{
   document.write('It is Liquid Water!' + '<BR>')
}
  if (theTemperature > 100)
  {
   document.write('It is Steam!' + '<BR>')
  }
  if (theTemperature < -0)
  {
   document.write('It is ice!' + '<BR>')
  };
document.write ('Thank-you for using this program.');
document.close ();
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>

i have written this program it goes all right untill i want it to display
steam but it say steam and liquid and this isn't what is intented. I know it
because i have put  >=  0 but i need to to stop at 100 because that when the
temprature becomes steam.
bit stuck
vicki

Signature

v davies

David Kerber - 09 Dec 2005 12:59 GMT
> if (theTemperature >= 0)  

if ( (theTemperature >= 0) && (theTemperature <= 100))

If you don't know what the '&&' means, then you need to do some serious
reading for your class.

Signature

Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).

vicki - 09 Dec 2005 13:11 GMT
>> if (theTemperature >= 0)  
>
[quoted text clipped - 3 lines]
>reading for your class.
> Hi Daviid
I tryed what u surggested but my program did'nt run at all with && (<=
100theTemperature))

Signature

v davies

vicki - 09 Dec 2005 13:12 GMT
>> if (theTemperature >= 0)  
>
>if ( (theTemperature >= 0) && (theTemperature <= 100))
>
>If you don't know what the '&&' means, then you need to do some serious
>reading for your class.

I mean &&(theTemperature <=100))

Signature

v davies

IchBin - 09 Dec 2005 23:31 GMT
>>> if (theTemperature >= 0)  
>> if ( (theTemperature >= 0) && (theTemperature <= 100))
[quoted text clipped - 3 lines]
>>
> I mean &&(theTemperature <=100))

http://www.w3schools.com/js/js_if_else.asp

Signature

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)

Roedy Green - 09 Dec 2005 16:20 GMT
><SCRIPT LANGUAGE = "JavaScript">

see http://mindprod.com/jgloss/javascript.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.