Name of the programmeName of Module with Code
BEng (Hons) Degree in Chemical, Mechanical Engineering
and Process Operation and Maintenance
Introduction to Computer Programming – EGI00105
Aim
The aim of the coursework is to demonstrate the problemsolving skills through C++ programming language /
MATLAB environment.
On completion, student should be able to:
• Explain the operation of a digital computer and its
Learning Outcomes
components.
• Develop algorithms and flowcharts for solving
engineering problems.
• Develop programs involving various control
statements, loops, arrays, string and functions.
List of Experiments:
S.NO Experiment name
1
Control statements in C++
Description
• To write a C++ program, algorithm and
draw a flowchart for the following:
• Ask the user to enter the number of
students and get the students marks scored
in ICP and display how many students
have scored above 60.
2
Two dimensional array
• To write a C++ program to create A
matrix and find the largest number in the
matrix A.
1|Page
3
Familiarizing with string
operations & functions
• To write algorithm, C++ program & draw
a flowchart to arrange the employee names
in alphabetical order.
4
• To write the C++ program to display
Familiarizing with
functions
between the predecessor and successor of
a number using function.
Item component
Marks
1
Aim
10
2
Algorithm & developed source code
30
3
Logical sequence of the program, input,
30
output , result & discussion
4
Conclusion & citation
10
5.
Viva
20
Total
100
Instructions
1. Plagiarism is a serious offence. In case of any plagiarism detected, penalty will be
imposed leading to zero mark. Policy and guidelines for dealing with plagiarism and
malpractice in the examination can be viewed by clicking:
http://portal.cce.edu.om/member/contentdetails.aspx?id=490
2. Reports are due one week after performing the lab exercise or as per the schedule
indicated by the course leader.
3. Course work should be submitted with an appropriate cover page with all details
clearly and legibly filled.
4. For online submission of course work, a pdf file with appropriate cover page mentioning
the name of student, student number and title of the course work should be uploaded
using the submission link created and made available by the module leader.
2|Page
Introduction to Computer Programming – EGI00105
Laboratory exercise
By (Name)
Course
Instructor’s name
Institution
City and State
Date
Aim
The aim of the laboratory exercise is to write algorithms using the C++ programming language.
The end result is programs that automate tasks for arbitrary inputs.
Control Statements
The algorithm takes as input the number of scores to be entered and in a for loop each score in
ICP. If the score is higher than 60 a counter variable previously initialized at 0 is incremented.
The number of scores higher than 60 is the value of the counter variable after the loop ends.
Two-Dimensional Array
The algorithm iterates over every entry of the two-dimensional array full of integers and for each
number, if the number is greater than the greatest number already encountered, the variable that
holds the greatest number is updated. When the iteration is over, the greatest number is the value
of the variable that was being updated every time a greater number was found.
String Operation and Functions
The algorithm iterates n times where n is the length of the array. In every iteration i, the
alphabetically smallest string after the i-th position is found and placed at the i-th position. When
the iteration is over, the array is sorted alphabetically.
Functions
A function with parameter an integer n is used to print the predecessor (n-1) and the successor
(n+1) of that integer.
Conclusion
Making use of the C++ programming language and the constructs of loops, conditional
statements and functions allows for the development of programs that automate tasks with
arbitrary inputs.