10 اليا 3 COS Build a CPP program with i. a class definition named Hostel with open access attributes blockName, roomNum
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
10 اليا 3 COS Build a CPP program with i. a class definition named Hostel with open access attributes blockName, roomNum
10 اليا 3 COS Build a CPP program with i. a class definition named Hostel with open access attributes blockName, roomNumber, AC/NonAc, Veg/Non Veg. Assume that students are already allocated with hostel details. ii. define another class named Student with hidden attributes regno, name, phno, Hostel object, static data member named Total_Instances to keep track of number of students. Create member functions named setStudent Details and getStudent Details. develop a friend function named Find StudentsBasedOnBlock with necessary parameter(s) to find all students who belong to same block. In main method, create at least three student instances. Sample Input: [21BDS5001, Stud 1, 9192939495, Block A, 101, AC, NonVeg], [21BCE6002, Stud2, 8182838485, BlockB, 202, AC, Veg], [21BIT7003, Stud3, 7172737475, BlockA, 102, NonAC, Non Veg), BlockA Expected Output: 21BDS5001, 21BIT7003, 2 out of 3 students belong to BlockA afinheritance with examnle classes Renresent each tune with tail 10
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!