Question: C++ .cpp file // object oriented Object Oriented Programming (CS11206) Bonus Project, Deadline 22-5-2018 01: Consider the following furniture class below, which represents an item
C++ .cpp file // object oriented
Object Oriented Programming (CS11206) Bonus Project, Deadline 22-5-2018 01: Consider the following furniture class below, which represents an item of furniture(. Each furniture item has a name, price, size, and color. Implement the following class. class furniture private string name,color; // color could be one of three (black, brown, blue) float price, size; public: furniture0; furniture(string n, string c, float p, float w) void setName(string n); string getName): void setColor(string c); string getColor): void setPrice(float p) float getPrice void setSize(float w); float getsize(l: 02: Create a class Room, which will represents a room in the house. Each room has a set of furniture items, and a fixed area. The room class should has the following: 1. Three variables: name string), area(float), items(array of furniture objects), noltems(integer, representing number of furniture items in the room) Three constructors default, parameterized, and copy constructor 2. Setter and getter for name and area Getter for noltems HasMoreltems(Room r2), which compares two room objects and return true if current room has more items getAvailableSpace(), which computes the difference between room area and used space by items in the room (each item will reserve a space in the room equal to its size). additem(furniture item), which adds a furniture item into the room. This function should check if there is space in the room for this item (if the total size of items in the room still leave space for this item, also if the room area is larger than the items size). If item was added successfully the function should return true, otherwise, it should return false 4. 5. 6. 7. 8. 9. getRoomColor), which will compute the most used color of items in the room and return it back. Q3: Write a main function to include: 1 Define a HOUSE as an array which has 5 rooms. 2- Add furniture items to the HOUSE rooms. Each room should at least has 3 furniture items. (Show both cases, where a room can include a furniture item successfully, and where it cannot) 3- Print out the room color for each room in the house 4 Print out the name of the room that has the less available space 5- Print out the name of the room that has the largest number of furniture items
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
