Professional Documents
Culture Documents
Prog 621
Prog 621
Page 1 of 2
SECTION A: (THIS SECTION IS COMPULSORY) (40 MARKS)
1.1 Write an e- ATM C++ console application that will request a user to enter a pin code firstly
and validate it. The app should then request user to deposit any amount of money. The
app should allow user to withdraw money. If the user attempts to withdraw amount
exceeding the current balance it should show an error message.
(40)
2.1 Write a C++ program that will prompt the user to input number of element of an Array.
This program takes n number of elements from user and stores it in array arr[].
To find the largest element, the first two elements of array are checked and largest of
these two element is placed in arr[0].
Then, the first and third elements are checked and largest of these two element is placed
in arr[0]. This process continues until and first and last elements are checked.
After this process, the largest element of an array will be in arr[0] position.
(30)
3.1 Write C++ Program to Check whether an input number is Prime number or not.
A number which is only divisible by itself and 1 is known as prime number, for example: 5
is a prime number because it is only divisible by itself and 1 (30)
To print star pyramid patterns in C++ programming, we have to use two nested for loops.
The outer for loop is responsible for the number of rows in star (*) pyramid triangle or
patterns whereas inner for loop will print the required number of stars * in each row. (30)
Page 2 of 2