CMPS 209 Final, Spring 2006

American University of Beirut · Computers and Programming for the Sciences · 10 pages

All CMPS 209 files
CMPS 209 Final, Spring 2006, page 1

Stuck on a question? A tutor can walk you through it.

CMPS 209 Final, Spring 2006, page 2 CMPS 209 Final, Spring 2006, page 3 CMPS 209 Final, Spring 2006, page 4 CMPS 209 Final, Spring 2006, page 5 CMPS 209 Final, Spring 2006, page 6 CMPS 209 Final, Spring 2006, page 7 CMPS 209 Final, Spring 2006, page 8 CMPS 209 Final, Spring 2006, page 9 CMPS 209 Final, Spring 2006, page 10

More CMPS 209 files

Show the text of this final exam
Department of Computer Science Spring 2006 CMPS 209 – Final exam- Sample Questions 90 minutes 1/10 Instructions: 1. Make sure that you have one answer sheet and a question booklet of 10 pages. 2. Everything you write on the answer sheet should be in HB-2 pencil. 3. Write your name and ID number on both the question and answer sheet. ID NUMBER FULL NAME SECTION ROOM Wing D WHCR SEAT NUMBER INSTRUCTOR Mr. Wassim Mukaddam Mrs. Hayat Bohsali SIGNATURE Department of Computer Science Spring 2006 CMPS 209 – Final Exam-Sample Questions 90 minutes 2/10 I. Programming The “VB Car Rental Agency” needs your help in building an application that calculates rental charges based on user selection. The agency offers two categories of cars: family cars and sports cars. The Car rental fees are shown in the following table: Rental Fees Family Car 50 $ per day for the first week + 30 $ for every additional day Sports Car 45 $ per day In addition to the car rental, the application should also display when user can pick the car from the agency depending on the day of reservation request. Pick Up Date High Season (June, July, August, December) After 5 days Regular Season Next Day As output, the program should display the rental fees based on the user selection and the duration. Moreover, it should display the pick up date based on table 2 above. Keep in mind that: Month Number of Days Jan, Mar, May, Jul., Aug., Oct., Dec. 31 days Feb 28 days Apr., June, Sept., Nov. 30 days We would like to build a VB.Net application that calculates and displays the rental fees along with the pick up date. The graphical user interface for the “VB Car Agency” project is shown below along with the skeleton of the click event procedure for btnReserve. txtTodaysDate txtDuration radSports radFamily btnReserve Department of Computer Science Spring 2006 CMPS 209 – Final Exam-Sample Questions 90 minutes 3/10 The program takes as input today’s date in dd-mm-yyyy format as well as the number of days the user wants to reserve the car. Before processing the input to calculate the fee, the program validates input in the following manner: • The program checks that today’s date contains 10 characters, as well as that the month is between 1 and 12. It should display an error message “Invalid Input” and discontinue the event procedure otherwise. Sample Output1: Assume the user wanted to reserve a family car for 10 days on 15-06-2006, the program will display: Sample Output2: Assume the user wanted to reserve a sports car for 8 days on 31-10-2005, the program will display: Department of Computer Science Spring 2006 CMPS 209 – Final Exam-Sample Questions 90 minutes 4/10 Your handwriting should be readable so that it can be graded. Private Sub BtnReserve_Click (ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnReserve.Click) …………………………………………………………………………………………………………………………………………………. ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………… End Sub Department of Computer Science Spring 2006 CMPS 209 – Final Exam-Sample Questions 90 minutes 5/10 II. SAMPLE Multiple Choice 1. ___________is also called repetitive motion injury and cumulative trauma disorder. a) BRM b) ARD c) EMI d) RSI 2. Program specification is also called ____________. a) program definition b) program design c) program modeling d) program coding 3. The ____ structure involves repeating a sequence until a condition is met. a) loop b) sequence c) conditional d) selection 4. Which step of software development involves typing statements into a computer? a) Specification b) Design c) Coding d) Maintenance 5. A term relating to receiving data from a satellite is a) uplink b) downlink c) modulate d) demodulate 6. 8-bits are equivalent to ______ bytes . a) 1 b) 8 c) 16 d) 64 7. This type of memory is nonvolatile storage . a) RAM b) ROM c) Flash memory d) b and c 8. Which binary coding scheme is typically used for mainframe computers? a) Unicode b) ASCII c) EBCDIC d) None of the above Department of Computer Science Spring 2006 CMPS 209 – Final Exam-Sample Questions 90 minutes 6/10 9. The issues that deal with the collection and use of data about individuals is a) access b) property c) accuracy d) privacy 10. Select one of the following that is a basic element of every communication system. a) Sending and receiving devices b) Communication channel c) Data transmission specification d) All of the above 11. As much as ____ percent of the total lifetime cost for an application program is for maintenance . a) 40% b) 50% c) 60% d) 75% 12. People who gain unauthorized access to computers for the purpose of doing damage are called ____. a) employees b) hackers c) members of organized crime d) crackers 13. When a hard disk crashes, it is an example of a ____ type of computer security threat. a) natural hazard b) criminal c) technological failure d) civil strife 14. A ____ acts as a security buffer between a company's private network and all external networks. a) firewall b) password c) disaster recovery plan d) virus checker 15. Most Web-enabled devices follow a standard known as a) FireWire b) Bluetooth c) TCP/IP d) Wi-FI 16. The capacity of a communication channel is known as _________. a) bandwidth b) bit capacity c) baud rate d) data flow Department of Computer Science Spring 2006 CMPS 209 – Final Exam-Sample Questions 90 minutes 7/10 17. A computer network must contain at least this number of computers. a) two b) a few c) twenty d) hundreds 18. This type of network spans the offices in one building. a) LAN b) MAN c) WAN d) WLAN 19. Which of the following is another name for a chip? a) Silicon chip b) Integrated circuit c) Semiconductor d) All of the above 20. The concept of linking people and resources via computer networks is known as a) computer linkage. b) embedded system communication (ESC). c) connectivity. d) objectivity. 21. The term used as a measurement of a communication channel's data capacity is a) broadband. b) bandwidth. c) protocol. d) data flow. 22. The central host computer or file server in a star network maintains control with its connecting devices through a) sharing. b) networking. c) enterprise computing. d) polling. 23. The acronym CPU stands for _________. a) central processing unit. b) Commomn procedural unity. c) Co- processor univac. d) control program unit. 24. The network strategy extensively used throughout the Internet is a a) terminal network system. b) peer-to-peer network system. c) client/server network system. d) none of the above. Department of Computer Science Spring 2006 CMPS 209 – Final Exam-Sample Questions 90 minutes 8/10 25. The Visual Basic programming language evolved from ____. a) BASIC b) Visual C++ c) Visual Studio d) COBOL 26. When the IDE is in ____ time, you can make modifications to the forms and code of any application or component. a) Run b) Modification c) Design d) Change 27. Which of the following is the best data Type to use for a variable that will store the number of cars in a parking lot? a) Single b) String c) Decimal d) Integer 28. When a project is opened, Visual Basic .NET opens the project within a ____. a) Solution b) data file c) panel d) all of the above 29. The default value for the Text property is ____, a generic name that Visual Basic .NET assigns when creating the form. a) 1Form b) NewForm c) Form d) Form1 30. To lock an individual control, select the control and then click the ____ command on the Format menu. a) Individual Lock b) Fixed Controls c) Constant Controls d) Lock Controls 31. The expression 5 \ 3 +1 evaluates to ____. a) 1 b) 3 c) 2 d) 5 32. In the mathematical expression 4*3+15/3-6 which operation is performed first? a) + b) * c) – d) / Department of Computer Science Spring 2006 CMPS 209 – Final Exam-Sample Questions 90 minutes 9/10 33. A relational expression that is preceded by the ____ logical operator forms a condition that is false when the relational expression is true. a) Not b) Rev c) Or d) Off 34. Which of the following would be an appropriate use of a check box control? a) Marital Status (Married, Single) b) Gender (Female, Male) c) Full Time - Part Time d) None of the above 35. Which of the following represents the correct syntax for declaring a variable? a) Dim myvar As Integer b) Dim myvar c) Dim myvar Integer d) Integer myvar 36. Which expression matches the phrase “Is the value contained in age less than 13?” a) age < 13 b) age = 13 c) age <= 13 d) age > 13 37. What data type should a counter variable have? a) Integer b) String c) Decimal d) Single 38. What is the effect of clicking on BtnTry ? Private Sub btnTry_Click() Const TRY = 125 TRY= TRY + 10 txtOne.text=Try End Sub a) The value stored in the constant TRY will be 10. b) The value 135 will appear on txtOne. c) The value stored in the constant TRY will be 135. d) The compile error “Assignment to constant not permitted” will be generated. Department of Computer Science Spring 2006 CMPS 209 – Final Exam-Sample Questions 90 minutes 10/10 39. The Mid( strEmpName, 1, 5) instruction is equivalent to which of the following? a) Left(strEmpName, 0, 5) b) Left(strEmpName, 1, 5) c) Left(strEmpName, 5) d) Right(strEmpName, 1, 5) 40. Given the following : Private Sub BtnExit_LostFocus() LostFocus is the name of the : a) Event procedure b) Event c) Action d) Action procedure ************* END OF EXAM *************