class SchoolBus { public: SchoolBus(int seats, int seatedStudents); bool addStudents(int students); bool removeStudents(int students); int getStudents() const; private: int seats;...

profilemuhabd1
class SchoolBus
{
public:
    SchoolBus(int seats, int seatedStudents);
    bool addStudents(int students);
    bool removeStudents(int students);
    int getStudents() const;

private:
    int seats;
    int seatedStudents;
};

Figure 1

The declaration for the SchoolBus class is shown in Figure 1. Instances of the SchoolBus class represent school buses of varying sizes. The class provides functions to add and remove students. The add and remove functions return false and do not modify the state of the object if the operation can not be done exactly as requested. For example, if there are 3 empty seats and you try to add 5 students, then the addStudents function returns false and does not change the number of seated students. There is a single accessor function called getSeatedStudents, which returns the total number of students seated in the bus.

1) Draw the UML class diagram for the SchoolBus class given in Figure 1

    • 9 years ago
    • 999999.99
    Answer(1)

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      uml.docx
    Bids(0)