![]() |
| ||
| Weather forcast class Hey everyone im working on a class in java that does several things. it is supposed to take a sky condition either sunny snowy cloudy or rainy and a temp between -50 and 150 f. the default sky is sunny and temp is 70. it needs a method that converts farenheit to celcius and a method that checks if conditions are consistent (temp < 32 not snowing temp > 100 not sunny, and a client to test it. I wrote a version of the class and some of it works, but im having a few problems. First off i cant seem to get my setTemp and setSky methods to work, and secondly I cant get the convert method to work. any help would be greatly appreciated. [code = java] |
| ||
| Re: Weather forcast class First: startSky != "snowy" and startSky != "sunny". Use method equals to campare stings. Maybe it will be better for you to use enum instead strings "sunny", "snowy" etc. In setSky method, when you get an error, you don't set the skyCondition. |
| All times are GMT -4. The time now is 6:28 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC