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

Do you require help with your paper? Use our custom writing service to achieve better grades and meet your deadlines. Trust our team of writing experts with your work today, and enjoy peace of mind.


Order a Similar Paper Order a Different Paper
class SchoolBus_x000D_
{_x000D_
public:_x000D_
    SchoolBus(int seats, int seatedStudents);_x000D_
    bool addStudents(int students);_x000D_
    bool removeStudents(int students);_x000D_
    int getStudents() const;_x000D_
_x000D_
private:_x000D_
    int seats;_x000D_
    int seatedStudents;_x000D_
};_x000D_

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

Writerbay.net

Our writing experts are ready and waiting to assist with any writing project you may have. From simple essays, research papers, lab reports, and dissertations, to online classes, you can be sure we have a service that perfectly matches your needs.


Order a Similar Paper Order a Different Paper