ITEC 120 LAB 14 | Back to Lab index page |
Activities at Lake LazyDays
As activity directory at Lake LazyDays Resort, it is your job to suggest appropriate activities to guests based on the weather:
if it is not raining:
80 degrees or higher : go swimming
60 <= temp < 80: play tennis
35 <= temp < 60: enjoy the golf course
below 35 degrees: go skiing
if it is raining:
80 degrees or higher : visit the
greenhouse
60 <= temp < 80: visit our spa
35 <= temp < 60: enjoy our shops
below 35 degrees: go skiing
Write a program (one program with one main method) that asks if it is raining, prompts the user for a temperature, then prints out the activity appropriate for that temperature.
Use a boolean variable to represent whether it is raining or not.
Try to represent your logic in a
simple, understandable way. Make it concise if you can. It will be very important
to use proper indentation when writing if statements.
Sample run 1
Program displays: | Is it raining? (yes or no) |
User enters: | no |
Program displays: | What is the temperature outside? |
User enters: | 75 |
Program displays: | Play some tennis on our fine clay courts! |
Sample run 2
Program displays: | Is it raining? (yes or no) |
User enters: | yes |
Program displays: | What is the temperature outside? |
User enters: | 40 |
Program displays: | Please visit our shops. |