Escolar Documentos
Profissional Documentos
Cultura Documentos
Lab 2 INDIVIDUAL
Modules Information:
Module
Session
Programme
Lecturer
Coursework Type
Hand-out Date
Due Date
Students Declaration:
I declare that:
I understand what is meant by plagiarism
This lab is all my own work and I have acknowledged any use of the published or
unpublished works of other people.
I hold a copy of this lab which I can produce if the original is lost or damaged
[Name/ID]
_______________________________________
[Signature] _______________________
[Date] _____________________
Lecturers Comments:
Description of Lab:
Question 3
Table Q3 shows the location of books in the library stacks according to their call numbers. Write a
program that requests the call number of a book as input and displays the location of the book.
Call Numbers
100 to 199
200 to 500 and over 900
501 to 900 except 700 to 750
700 to 750
Table Q3
Location
Basement
Main floor
Upper floor
Archives
Question 4
Figure Q4 shows some geometric shapes and formulas for their areas. Using Switch Case
blocks, write a program that requests the user to select one of the shapes, requests the
appropriate lengths, and then gives the area of the figure.
r
Circle
3.142 * r ^ 2
l
Parallelogram
l*h
w
l
Kite
(l * w) / 2
Figure Q4
Question 5
Table Q5 contains information on several states. Write a program that request a state as input
and display the requested information (flower, motto, and nickname). If the state is not in the
table, the program should inform the user.
Flower
Golden poppy
Peony
Magnolia
Rose
Nickname
Golden State
Hoosier State
Magnolia State
Empire State
Table Q5
Motto
Eureka
Crossroads of America
By valor and arms
Ever upward