Answered step by step
Verified Expert Solution
Question
1 Approved Answer
programming fundamentals Q.No.1: [2+3+3=08 marks] Consider the data of following two tables. Department DepartmentID DName Contact No 1 UIIT 0300-1234567 2 UIMS 0300-4567891 Student RollNo
programming fundamentals
Q.No.1: [2+3+3=08 marks] Consider the data of following two tables. Department DepartmentID DName Contact No 1 UIIT 0300-1234567 2 UIMS 0300-4567891 Student RollNo Sname Fname DepartmentID 111 Ali Ahmed 1 112 Sana Waqar 2 113 Afzal Ikram 2 There are only two departments and are already initialized globally, but students can be upto 100 and just defined globally. To maintain how many student's record have been entered you can use global variable with name as count. Write a C++ program having: A) Structures, structure definitions and required initializations for the above scenario. B) Function which takes input data (RollNo, Sname, Fname and DepartmentID) of student from user within the function, then verify that the DepartmentID exists in Department or not? If exists then copy DName and ContactNo in the student record along with above input, otherwise just display a message that department does not exists. For example the following record will not be allowed to store in the Student table because departmentID 3 instance is not available in the department table. 115 Farooq Bilal 3 C) Function which displays number of students in each department in the following format, note that you should be the first student in ULIT and your data should be displayed in first row (Add screen shot of your output): Total Student Enrolled: 03 Students enrolled in UIIT: 02 Student enrolled in UIMS: 01 Seats Vacant: 100-03=97 Roll No Sname Fname DName Contact No YourNo YourSname YourFname UIIT 0300-1234567 112 Sana Waqar UIMS 0300-4567891 113 Afzal Ikram UIIT 0300-1234567Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started