0% found this document useful (0 votes)
102 views12 pages

Is122 Exam 202203

Uploaded by

sivokidaveta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views12 pages

Is122 Exam 202203

Uploaded by

sivokidaveta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Name: _________________________________ Student ID: ____________________ Seat #: _____

IS122: Application Programming


School of Information Technology, Engineering, Mathematics, and Physics

Final Examination
Semester 2 2022

F2F/Online Mode

Question and Answer Booklet


Duration of Exam: 3 hours + 10 minutes

Reading Time: 10 minutes


Writing Time: 3 hours

Total Marks: 50 (50% of Final Grade)

Course Learning Outcome Covered:


This test covers the following course learning outcomes:
1. Explain the basic constructs of programming.
2. Explain ethical practices in programming.
3. Outline requirements for small-sized programming problems.
4. Develop simple application programs
5. Solve a well-defined problem using application programming

Instructions:

1. This exam has four sections, and All are Compulsory:


2. Write your answers in the space provided in this Booklet.
3. For Section A – use page 5 of this booklet:
• Select a multiple-choice answer by putting a circle around that letter.
• Correct mistakes by putting an “X” through the circle or erasing it completely.
• If you put an “X” through a circle, it will be considered unmarked.
• Ambiguous selection will be counted as incorrect.
4. There are 12 pages in this paper including this cover page.
5. Minimum mark to pass this exam is 20 marks (20/50)
6. Please hand in this booklet to the examination supervisor before leaving the examination
room.
Name: ____________________________________________ Student ID: _____________________

Section A: Multiple Choice Questions (15 marks)

This section has 15 questions. Circle the answers on the grid provided on page 5.

1. Every variable and named constant have ________________________.


a. Name
b. Datatype
c. Scope
d. All of the above

2. Microsoft's Visual Basic language was launched early in


a. 1980s
b. 1990s
c. 1960s
d. 1970s

3. Which of the following is the correct Visual Basic assignment statement for the following
formula?

Assume all variable declarations have been made. Use the Math.Pow function, which
can be used as Math.Pow(x, y) to mean xy .
a. v = 100 – Math.Pow(2 , 3, 100) - B
b. v = 100 – Math.Pow((2 / 3) , 100) - B
c. v = 100 – Math.Pow(2 / 3 , (100 – B))
d. v = 100 – Math.Pow((2 / 3) ^ (100 – B))

4. A(n) __________ allows users to select single input as the answer to the question.
a. radio button
b. checkbox
c. textbox
d. menu

5. Which of the following is not part of declaring a variable in VB.NET?


a. Dim keyword
b. As keyword
c. Semicolon
d. Variable Datatype

Page 2 of 12
Name: ____________________________________________ Student ID: _____________________

6. The statement that checks whether the quantity is between 0 and 14 (both inclusive)
is ______________.

a. If quantity >= 0 Or quantity <= 14 Then


b. If quantity > 0 or quantity < 14 Then
c. If quantity >= 0 And quantity <= 14 Then
d. If quantity > 0 And quantity < 14 Then

7. IDE stands for _______________________________________

a. Integrated Design Environment


b. Integrated Development Environment
c. Intelligent Definition Environment
d. Intelligent Development Environment

8. What is the value of txtMsg after the following code snippet has been executed?

txtMsg.Text = (25 / 4).toString()

a. 6.25
b. 6
c. (25 \ 4)
d. Error Invalid Code

9. How can you make the groups operate independently if you want two groups of three
radio buttons each on a form?

a. Put the radio buttons as far away on the form as possible.


b. Create a group box control on the form and put all six radio buttons together in
that group box control.
c. Make sure the radio buttons are separated by buttons.
d. Create two group box controls on the form. Draw three radio buttons in each
frame by clicking and dragging the radio button control from the toolbox

10. Which of the following will append “My name is Brandon” onto the current contents
of a label called lblText?

a. lblText.Text = “My name is Brandon”


b. lblText.Text = “lblText.Text” & “My name is Brandon”
c. lblText.Text = lblText.Text & “My name is Brandon”
d. lblText.Text = lblText.Text & My name is Brandon

Page 3 of 12
Name: ____________________________________________ Student ID: _____________________

11. Consider the following Visual Basic code and select the statement that is true:

Const Dim dblX As Double

a. This is a syntactically correct declaration of a real (floating point) variable.


b. This VB code has syntax errors.
c. This is a syntactically correct declaration of a double constant variable.
d. Rewrite the line of code to Dim intX as Integer so that the program can run
without errors.

12. Which of the following is a process-oriented programming language?


a. c
b. c++
c. c#
d. Visual Basic

13. Which of the following is the correct way of naming a Label with the name Majors?

a. lblMajors
b. txtMajors
c. lbMajors
d. Majors

14. The compound operator ____ subtracts the value of the right operand to the value of
the left operand and stores the result in the left operand’s variable.

a. --
b. =-
c. ==
d. -=

15. Which of the following is the correct way of naming a textbox with the name Salary?

a. txtSalary
b. textSalary
c. txSalary
d. tSalary

Page 4 of 12
Name: ____________________________________________ Student ID: _____________________

IS122 Application Programming Answer Booklet

1 A B C D

2 A B C D

3 A B C D

4 A B C D

5 A B C D

6 A B C D

7 A B C D

8 A B C D

9 A B C D

10 A B C D

11 A B C D

12 A B C D

13 A B C D

14 A B C D

15 A B C D

Page 5 of 12
Name: ____________________________________________ Student ID: _____________________

Section B: Short Answers (14 marks)

This section has five questions. All are compulsory.

1. One of the critical fundamentals that an application designer must exhibit it’s
their ability to use the Program Development Life Cycle. Complete the cycle
by identifying all the phases (3 marks)

F B

E C

Phase A: _____________________________________________________________

Phase B: _____________________________________________________________

Phase C: _____________________________________________________________

Phase D: _____________________________________________________________

Phase E: _____________________________________________________________

Phase F: _____________________________________________________________

Page 6 of 12
Name: ____________________________________________ Student ID: _____________________

2. What is the output of the codes shown below? (4 marks)

a. Code:

Output: (2 marks)

b. Code:

Output: (2 marks)

Page 7 of 12
Name: ____________________________________________ Student ID: _____________________

3. Working with Arrays (3 marks)

a. Declare an array of size 5 with initial elements as the weekdays (2 marks)

b. Discuss one major limitation of arrays. (1 Mark)

4. Write a statement to convert the value in the String variable strNumberOfCourses to


an integer value and place the integer value in a variable named dblCourseTotal.
(2 mark)

5. Use a For … Next loop to calculate the following series. After the loop terminates write
to display the sum. Use the given variables in your code (2 mark)

Dim intCounter As Integer


Dim dblSum As Double

Page 8 of 12
Name: ____________________________________________ Student ID: _____________________

Section C: Designing Application (6 marks)

1. User Interface design: You have been contacted by Yummy Meal Services to design
an application for them. They want you to create an application that will calculate
the cost of meal plans.

They have three types of meal plans available: Keto ($100), Low Carb ($80), and
Protein Rich ($150). The amount listed depicts the meal plan charges. Each customer
wishing to buy out these meal plans will only be allowed to choose one of the meal
plans in any given subscription. Customers can also request special dietary
requirements to be included in their meals. These additions include Gluten Free ($5),
Diary Free ($6), Vegetarian ($4), and Vegan ($8). Additional dietary requests are paid
for only once per meal plan.

The application should also allow customers to choose the number of meals they
want as part of their plan. For instance, the customer wants 5 meals altogether in the
keto plan. Finally, the application should display the cost of the meal plan whenever
the user clicks the calculate button. (6 marks)

Page 9 of 12
Name: ____________________________________________ Student ID: _____________________

Section D: Coding (15 Marks)

1. Consider the following UI design for a program that accepts letter grades for two
courses (CS140 and IS328) and then reports one of the following messages:

A. If only CS140 is passed, report “Doing good in CS only”


B. If only IS328 is passed, report “Doing good in IS only”
C. If both CS140 and IS328 passed, report “Doing good in CS and IS”
D. If neither CS140 nor IS328 passed, report “You are in trouble”

The following are the properties of the controls used in the form:

 Textbox for CS140 – txtCS


 Textbox for IS328 – txtIS
 Label for Report – lblReport
 Analyze Grade Button – btnAnalyse
 Exit button – btnExit

i. The first thing the program does is check the validity of the grade entered for
each course. Write a function called ValidGrade which accepts a grade (string)
as input and returns true if the grade is valid and false otherwise. Valid Grades
are “A’, “B’, “C’, “D", and "E”. (5 marks)

Page 10 of 12
Name: ____________________________________________ Student ID: _____________________

ii. Write a function called PassedCourse which accepts a grade (string) as input
and returns true if it’s a passing grade and false otherwise. Passing Grades are
“A’, “B’, and “C’. (5 marks)

iii. Complete only the required functionality for the click event handler for
btnAnalyse. (5 marks)

Using the function defined in (i) check for validity of CS140 and IS328 grades. If
both are valid then using the function declared in (ii) check if only the first
condition is satisfied that is

If only CS140 is passed, report “Doing good in CS only”

THE END
Page 11 of 12
Name: ____________________________________________ Student ID: _____________________

Extra Sheet

Blank Sheet
Page 12 of 12

You might also like