CMPS 209 Final, Fall 2001
American University of Beirut · Computers and Programming for the Sciences · 7 pages
More CMPS 209 files
Show the text of this final exam
taatitne oe CNIVERSITY
| LIBKARY
j Ok REIRUY
a
American University of Beirut
Math209-Computer & Programming for the Sciences
Final — Fall 2001/2002
Time: | h 30 min
Name : Instructor: Mrs. Bohsali
Id Mrs. Tabsh
Mr. Mukaddam
Use the back of the paper as a scratch
PENALTY IS CONSIDERED AS 4 TO 1
A. MS. EXCEL (35 pts)
I- Label the following chart :
a b
i
eS
Employee Récords}
Sue: Pal
illustrate sales for four regions in a quarterly period. The sales values for
, and the different colored columns used to differentiate one region from the
a) plot values; data series” b) data labels; categories
c) data series; data matkers d) data markers; data series
2) Which chart would best illustrate a part to whole relationship between each region’s sales and total sales each
month in a six month period.
~a) apie chart b) astacked-column c art
c) acolumn chart qd) a line chart
3) A line chart has been created to show a change in temperature over a 12 month —period for four countries.
Where would you expect to find the numbered scale of temperatures”
a) on the x-axis b) on the legend
c) inthe chart title -d) on the y-axis
nn emanemnenell
famenic AN UNTVERSIT
LIBRARY
OF BEIRUT
+) One of the most important features of spreadsheets is the ability to
a) cut and paste. b) undo errors.
c) dynamically link files. d) recalculate values.
5) The feature makes entering long headings easier by repeating and extending the series.
a) AutoComplete b) AutoFill
c) AutoType d) None of the above
You should select if you want to freeze the headings in row 9.
a) Row 8 = b) Row 10
c) Col8 d) Col9
You want to display the lowest bowling score in the league. The fastest way to do
use the function.
_a) MIN b) LOW
c) SUM d) COUNT
8) The Autofit feature:
-a) completes a sequence such as Jan, Feb, Mar, ...
b) copies cells by dragging the borders of a cell
c) sets the row height to the minimum necessary height to
dy none of the above
Column B displays a series of number signs (#) across’
a) erase the cells.
b) change the numeric format of the cells to
-c) increase the column width.
d) decrease the column width.
10) Pressing the Del key on the keyboards
a) Clear the format of a cell without
b) Delete the cell
ion =[F(ANS} 2 NSWER*2, 0), ANSWER>230 is an example of a
, and 0 is an éxample ofa
rguriel +) logical test; false argument
‘gument d) logical test; true argument
12) An IF function, IF(SALES>=10000,SALES*.06,0), has been entered into cell BS to calculate
commission, If SALES is $10,000, BS will display the value__as a result.
b) 6000
c) 0 d) 60
13) In the function =SUM(B12:B20), the argument is
a) the overall structure of the function. -b) B12:B20
c) SUM. d) the “=” sign.
Tr Wye
14) The formula H9*G3 +D5 has been copied from cell E4 to F2, the formula bar will display
when the cell selector is in cell F2.
a) I9*H3+ES cb) 17*H1+E3
c) F7*E1+B3 d) H2*G2+D2
LIBRARY
, OF BEIRUT
15) Row 21 contains total sales values for the first quarter period. C21, D21, and E21 contain totals for
January, February, and Mare:
h respectively. F21 contains a formula that calculates a grand total for
the quarter. C23 contains the formula =C21/F21 calculating the percent of January’s sales to the
grand total. You want to adjust this formula so you can copy it to cells D23 and E23. Which of the
following formulas should you use?
b) =$C21/F21
a) =$C$21/F21
d) =C21/F$21
c) =C21/$F$2]
Visual Basic (65 pts)
I- Multiple choice (33 pts)
When two procedures in different forms need to u:
variable.
a) module-level
b) global-level
c) local-level
d) static-level
€) None of the above
Which of the following is the best data T
numbers in the range 0 to 20,000?
a) Currency
b) Integer
c) Long
d) Single
e) Variant
ype to use for’
- Which of the following constants’tell:
a) Advance
b) VbGoToNewLine
control to execute code at regular intervals,
check boxes that can be selecte
a) One
b) Two
c) Three
d) Four
€) Five
d at any one time?
AM ERICAN UNIVERS!
LIBRARY
OF REIRUS
is a local variable that retains its value when a procedure ends.
constant variable
Static variable
consistent variable
literal variable
none of the above
What is the result of the expression 23 -32/4*2+6
a) -47
27
-2
11.0625
none of the above
a)) TxtName.text="BOB”
b) Txtname.text=Ucase(“BOB”)
c) Txtname.text=Ucase(“Bob”)
d) Ucase(txtName.Text)="Bob”
ee Ucase(txtName.Text)= “BOB”
Which of the following will prompt the user for a nurnber,
to the sngNum Variable?
a) InputBox(“Enter the street number:”,”Nugnber
b) sngNum= InputBox(“Enter the street, nyniber:”, "Ni
c) Number= val(InputBox(“Enter thegé
d) sngNum= val(InputBox(“Enter,
e) None of the above :
10. Which of the following i
a) Val(txtAge.txt > 65)3°°""
8 Val(Iblprice.captiop) > 0 an
(> Cursales > 100 andkgirCést <=
d) UCase(strState) = “Alagka
e) None of the above :
ariable contains the number 200. What value will be in the intNumber
variable after the following selection structure is processed?
If intNuibe2”<=100 Then
intNumber= intNumber*2
ElseIf intNumber >500 Then
intNumber= intNumber*3
EndIf
. a) 0
c) 180
Uil-Fill in the Blanks (16 pts)
1. What follows are the steps for an event procedure that will calculate a lucky number based on user
input. Replace the English statements, given as comments, with their corresponding VB statements.
You can only use the variables declared.(8 pts)
Private Sub cmdLucky_Click()
Dim luckyNum as Integer
Dim user_Input as Single
a) ‘Ask the user to enter a number and store it in user_Input. i
‘ Add 5 to the variable usex_Inpu
‘LuckyNum. :
ai
d) ‘ Display the value OLS i
0.
‘and has one butto:
4,
AMERICAN UNIVERSIT
q¥ LIBRARY
4 OF BEIRUT
—
IIl- Output (16 pts)
1, What is the output of the following nested if statement when X=209 ?
If x>10 then
MsgBox “X is in the order of 10's”
Elseif X>100
MsgBox “X is in the order of 100's”
Elseif x>1000
MsgBox “X i in the order of 1000’s”
Else
MsgBox “X i between 0 and 10 ”
End If
d=]
Do While i< 4.
For j=1 To i
n=nitil
Next j
deitril
Loop
n= i=
Given the following code:
Private sub cmdTest_click
n
a
b=
What is the value of s after the following code executes?
Dim temp As Integer
Dim s As String, out As String
s = "ABRacadaBRA"
temp = Len(s)
If Mid(s, 2, 1) < Left(s, 2) Then
s = LCase(s) &s
s = Left(Right(s, temp),5
Else
s = UCase(s) &s
s = Right (Left(s, temp), 4}
ERICAN UNIVERSIT?S
LIBRARY
OF GEIRUT
2. A palindrome is a number or text phrase that reads the same backward as forward. For example each
of the following words is a palindrome: radar, toot, madam. (8 pts).
One way of checking if a word is a palindrome or not, is to reverse it, and then check if the reversed
word is the same as the original one.
Complete the following piece of code in order to check if the input word is a palindrome:
Private Sub CheckPalindrome_Click(}
Dim word As String, reverseWord As String
Dim I As Integer
word = InputBox ("enter a word and I'll tell you if it is a palindrome
a) ‘Reverse the word
For l=
Next
b) ‘Check whether it is a palindrome, and displaygi
Good Luck ©