CS 113 Lab 7 - Decisions

Objectives: Learn how to create and use decision statements.

 

What to do?

Read sections 5.1-5.2 of the textbook.

Design a VB program that gives you advice based on the current outside temperature. You enter the current temperature (T), click a button and the program generates the following messages:

It's freaking cold out there, better get some warm clothes on. (if T<32)

What a gloomy weather. Perfect for sleeping and staying at home. (If T>=32 and T<50)

Time to play outside! (if T>=50 and T<70)

It's time to bake in the sun and hit the beach! (Temp>=70)

 

The interface of the program along with its output generated after several different values of temperature is shown below.

 

Design a VB program with the interface as shown above. Make sure the objects in your program are as follows:

 
Object                    Property                  Setting                       
frmTemperature Caption Weather Advisor
label1 Caption Please enter current temperature
txtTemp    
cmdAdvice Caption Give me some advice!
picResult    

 

Save your work.

 

Due date

No later than 11:55 pm on April 7, 2007.

 

What to submit

Use Blackboard Vista to submit the Visual Basic Form File with your program.