CSCI 2000B
Spring 1999
Lab 4
This in-lab assignment includes running and/or changing three QBASIC programs to prepare you
for the out-of-class assignment for the week.
Program 1:
a) Load in the first program LAB4PT1.BAS
b) Read over the program.
c) Run the program and enter data that will generate a profit.
d) Run the program and enter data that will generate a loss.
e) Modify the program to output a dollar sign in front of the profit or loss and change my name to yours in the REM statement at the top of the program.
f) Run the program and enter data that will generate a profit of zero.
g) Modify the program to output the message "There was no profit or loss" if the calculation results in an answer of zero.
h) Print the program to turn in.
Program 2:
a) Load in the program LAB4PT2.BAS.
b) Read over the program.
c) Run the program and test the program for words that begin with vowels and for word that begin with consonants.
d) Correct the program by testing for words that start with "u" and handling them like the other vowels.
e) Change to your name, retest and print the program to turn in.
Program 3:
a) Load in the program LAB4PT3.BAS.
b) Read over the program.
c) Run the program and write down the result.
d) Change the program to allow the user to input the coefficients of a, b and c. Make sure the prompts are reasonable so the user knows what number to enter when.
e) Test the program for a=1, b=3 and c=-10.
f) Test the program for a=3, b=-5 and c=7. (No real solutions)
g) Test the program for a=4, b=12 and c=9. (One double solution)
h) Modify the program to print out the equation to look like the expression in the remarks but with the actual coefficients included. Retest.
i) Change the program to have your name and print it out.