

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


1. Understanding if statements (practice question)
Given the following program fragment with the variable carID as an integer and Type as a string:
If carID < 100 Then Type = “modelA” Else Type = “modelT” End if If carID < 50 Then Type = “modelZ” End if
If the value of carID is 25 before these statements, what is the value of Type afterwards?
If the value of carID is 75, what is Type?
If the value of carID is 125, what is Type?
2. Writing a Loop (practice question)
Suppose that every year, I plan to save $150 in my bank account. My initial balance is $500 (and I am not going to get any interest). How much money will I have in my account after 5 years? Declare the variable balance and any other variables that you need and write a loop that will compute the final balance.
3. General Procedure
Start a new project and name it something like SimpleProc (for simple procedure).
Create the user interface for the simple procedure demonstrated in class that has three buttons:
Double the number 17 Double the number - Close
Use the code given on the web page for the twice procedure and for the buttons. Test this program to make sure that all the buttons work.
Now change the program so that is triples two (different) numbers.
Test your program to make sure that it works.