CSC115, Introduction to computer Programming, Fall 09 Project Preparation

1. Use Nested-if to build the code for the following problem.

Percentage of cloud cover Descriptor 0-30 Clear 31-70 Partly cloudy 71-99 Cloudy 100 Overcast Table 1. a) Table 1 gives the terms used by the National Weather Service to describe the degree of cloudiness. Write a program that requests the percentage of cloud cover as input in a textbox and then, displays the appropriate descriptor in a listbox. b) IRS informants are paid cash awards based on the value of the money recovered. If the information was specific enough to lead to a recovery, the informant receives 10 percent of the first $75,000, 5 percent of the next $25,000, and 1 percent of the remainder, up to a maximum award of $50,000. Write a program that requests the amount of the recovery as input in a textbox and displays the award in a listbox.

Abbreviation Meaning ac Before meals ad lib Freely as needed bid Twice daily gtt A drop Hs At bedtime Qid Four times a day Table 2. c) Table 2 contains the meanings of some abbreviations doctors often use for prescriptions. Write a program that request an abbreviation as input in a textbox, and gives its meaning in a listbox. The user should be informed if the meaning is not in the table. d) Programming project 1 in book on page 163

2. Use select case to build the code for the following problem. a) Table 1 gives the terms used by the National Weather Service to describe the degree of cloudiness. Write a program that requests the percentage of cloud cover as input in a textbox and then, displays the appropriate descriptor in a listbox.

Number grade Letter grade 100-90 A 89-80 B 79-65 C 64-60 D 59-0 F Table 3. b) Input your grades from 0 to 100 in a Text-box. If the value of a grade is not a number between 0 and 100, show a message in the listbox “Please try again” to the screen; Otherwise print the letter representation (A,B,C,D,F) of the number grade in a listbox. Table 3 shows the appropriate number to letter grades assignments:

Call number Location 100 to 199 Basement 200 to 500 and over 900 Main floor 501 to 900 except 700 to 750 Upper floor 700 to 750 Archives Table 4. c) Table 4 shows the location of books in the library according to their call numbers. Write a program that requests the call number of a book as input from a textbox and displays the location of the book in a listbox.