Results 1 to 4 of 4
Thread: helpp lol
- 03-26-2009, 02:03 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 4
- Rep Power
- 0
helpp lol
Write a Java class to process a collection of 12 daily temperatures. Your program should prompt the user to enter the 12 daily temperatures and then the temperatures stored in an array .The program should then count and print the number of hot days (temperature 38 or higher), and the number of pleasant days (temperatures less than 38), it should also display the category of each temperature. First of all you will need to create a class diagram using MS Visio for this class showing its attributes as well as the operations and then write a pseudocode in the space provided.
so far i've put together this.
START LOOP
INPUT
1.0 GET 12 daily temperatures
1.1. STORE daily temperatures
LOOP UNTIL 12
OUTPUT
2.0 Count AND PRINT days 38> and category (hot days)
2.1 THEN PRINT days <38 and category (pleasant days)
END LOOP
this is pretty basic, but im really new to java and struggling!
ryan
- 03-26-2009, 02:15 PM #2
Looks pretty good ... it's rare for somebody to start with pseudo code .... always do that... good habit.
My question here would be: how do you know what day has which temperature? Are you planning capturing the day and the temperature? If yes, what do you think you could use ?
Luck,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 03-26-2009, 02:33 PM #3
Member
- Join Date
- Mar 2009
- Posts
- 4
- Rep Power
- 0
it basically has to display how many days are cold and how many days are hot.
any ideas how the code would look? :S confused
- 03-26-2009, 02:56 PM #4
hashtable & 2D array
So I'm assuming that you need both the name of the day and the temperature. What first comes to mind is to use a habletable, although a 2D array could probably also work.
Hashtable:
Hashtable (Java 2 Platform SE v1.4.2)
Example:
Java Hashtable Example
Luck,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks