0% found this document useful (0 votes)
24 views2 pages

Fall23 Final

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

Fall23 Final

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

PMAS Arid Agriculture University Rawalpindi

University Institute of Information Technology

Final Term Examination-Fall-2023


BSSE/BSCS – 1st (M/E)
Programming Fundamentals
CSC-101
Registration No.________________ Theory Total Time: 1.5 hr
Maximum Marks: 30
-----------------------------------------------------------------------------------
Question 01: 10 Marks
Write a program to manage the seating arrangement for the Arid University main auditorium. The auditorium has a
grid-based layout. Each element in the array (defined in main function) corresponds to a seat, with the value indicating
whether the seat is occupied (1) or empty (0). Define a function name with initialize_seating that takes the array,
number of rows and columns in the auditorium as an argument. This function gets values from user for randomly
assigned occupied or empty seats. Write another function, display_seating, that prints the current state of the seating
arrangement, providing a visual representation of the auditorium layout. After that write a function
named reserve_seat which takes the row and column as an argument to indicate a seat and updates the seating array to
mark that seat as reserved (2). Additionally, we create a function called check_availability that checks whether a
specific “seat is available” for reservation or “Seat is already reserved”.
Question 02: 10 Marks
Aridian Premier league(APL) is an Annual event held at PMAS-AAUR. There are total of 50 teams registered in this
event, each team is recognized by name, id, dept. Each time consist of 13 players. The main characteristics of players
are name, arid_no, dept, player_role. this time management of APL wants to automate the registration process. You
were assigned a task to write a c++ program which defines global memory for the data of teams. Write a function to
input the data of teams also a function to show the data of each player. Also write another function search_player()
which displays the record of individual players and associated team. This search can be done either by arid_no or by
name using a single variable. For multiple matching records all records will display. If no data matches then one time
message should display that “Record not found”. Use char array for all kind of string data and all strings consists of
single word means without spaces.
Question 03: 06 Marks
Create a program that manages different transactions like checking the balance, depositing money, and withdrawing
money. Initial account balance is Rs. 10,000.
Develop multiple versions of the function “process transaction” based on the type of transaction (two options i.e.
deposited or withdrawl). The first version should have two parameters: the transaction type (char array) and the
transaction amount. If the user does not specify the transaction type, the function should assume it’s a withdrawal.
Also if user does not specify both arguments, the function should assume it’s a withdrawal of 1000 Rs. Ensure that the
account balance is adjusted correctly for each transaction type and show the updated balance after each transaction.
Question 04: 04 Marks
The swap() function below, takes two positive integers as an argument and swaps the values. Convert this function
using pointers for the same output.

#include<iostream>
using namespace std;
void swap(int n1, int n2) {
int t=n1;
n1=n2;
n2=t;
}
int main() {
int n1=5; int n2=8;
swap(n1,n2);
cout<<n1<<'\t'<<n2;
return 0;
}

*****Good Luck*****
PMAS Arid Agriculture University Rawalpindi
University Institute of Information Technology

Final Term Examination-Fall-2023


BSSE/BSCS – 1st (M/E)
Programming Fundamentals
CSC-101
Registration No.________________ Practical Total Time: 45 min
Maximum Marks: 20
-----------------------------------------------------------------------------------
Question 01: 06 Marks
Write short description of your project in 3-4 lines.

Question 02: 04 Marks


Write short description of the most interesting lab of your course in 2 lines.

Question 03: 10 Marks


Assume you have the following key of Microsoft office 2019 in a file key.dat:
6P6FJ-WHBQ2-M2H4B-Q6RQJ-JYDKR
Write a C++ code for the following functions:
a) get_User_Key() function which gets office key from user and return the key (2 marks)
b) get_File_Key() function which reads key from the file key.dat and return the key (2 marks)
c) compare_Key() , which compares both keys, return true if both are same, otherwise return false (2 marks)
d) update_Key() function which calls above all 3 functions in its body and if compare_Key() function return true
then call get_User_Key() function again and replaces the previous key in the file with the new key. (4 marks)

Note: main() function is not required but you have to add required header files.

You might also like