Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


CS304 Assignment No 2 (Last Date Dec 10)

Problem Statement:

Keeping in view the above class diagram, you have to write code for the below mentioned classes and show their relationship with each other:

 

1. Class Bus:

Attribute:

BusNo:string

SeatingCapacity:int

SeatsReservedSofar:int

 

Methods/Operations/Getters/Setters:

GetSeatingCapacity():int

SetSeatingCapacity(bCap:int)

GetBusNo():string

SetBusNo(bNo:string)

ReserveSeat(p:Passenger)

DisplayInfo()

 

2. Class passenger:

 

Attribute:

Name:string

Gender:char

 

Methods/Operations/Getters/Setters:

SetPassengerName(name:string)

GetPassengerName():string

SetGender(gender:char)

GetGender():char

 

Hint: You have to implement the relationship of aggregation between class “bus” and “passenger” through C++ code.

  • Your program should allow the user to enter information of bus while creating and information of passenger while adding a passenger in bus.
  • It should give option (yes/no) to add more passenger if capacity of bus allows.
  • After adding the last passenger (i.e. when adding a passenger makes buss full) or “No” is selected as option, it should display the complete summary about bus and all passenger in bus as shown in output below. 

 

Output:

Views: 12423

Attachments:

Replies to This Discussion

discussion..

working on it, will share soon

Okz....

jaldi Karo :) Rafey Bhai :P :D

is me jo class diagram di hui h wo first assignment wali h 

working :)

kb hogi

samaj mei nae aa raha

good keep working on it .............

mujhy bi chay cs304 assignment

guys i am stucked on a module wher we pass passenger class object , what to do with this module? :(

reserveseats wala 

lagta h admins ko b solution samaj nahi arha

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service