You are on page 1of 2

Basra University– College of Engineering

Petroleum Engineering Department

Subject: Computer Programming I Exam: 2nd semester-Final


Class: 1st year Date: 8/8/2021
Examiner: Assist. Lect. Haider S. Mohammed Time: 3 Hours
Note: Attempt all questions
Q1] (6 + 10 Marks)
A) Write a program to generate the numbers following:
(22, 20, 18, 16, 12, 10, 9, 8, 6, 5, 4, ,3, 2, 1) on ListBox, by using For…Next Loop.

B) Create a Visual Basic Project to find the value of the following series.
𝑥2 𝑥4 𝑥6 𝑥8
Cos(𝑥) = 1 − + − + −⋯
2! 4! 6! 8!
Write the code program so that the value of angle (𝑥) is entered into TextBox and
the number of terms (N) is entered into input box. Calculate the value of series and
display the result of series (Cos(𝑥)) in another separate Textbox.
____________________________________________________________________
Q2] (6 + 10 Marks)
A) Create an array to holding 8 engineering departments by using ListBox, and try to
sort the array then reverse it.
B) Write a code program to read a two-dimensional array (A), and assign values to an
array (A) by using the counter. Also, print the largest value and the location (i and
j) in a TextBoxes.

(1-2)
Q3] (6 + 10 Marks)
A) Write a code program to read four integer numbers. Using a define sub procedure
(Maximum) to determine the largest of four integers. Display the largest value in
TextBox.

B) Create a Visual Basic project to find the value of function f(Z) from the equations
are below, by using a define Function procedure.

Write a code so that the value of variables Y and Z are entered into two TextBoxes.
Display the value of function f(Z) in separate (labeled) TextBoxes when click
Button1. Design form window and select all the control objects are used.
__________________________________________________________________
Q4] (7 Marks)
Create text file using stream writer, then write and read the file information?

Examiner Head of the Department


Haider Sami Mohammed Dr. Hussein Sadiq Sultan

(2-2)

You might also like