Need Help ?

Home / Expert Answers / Other / 2-create-a-class-box-each-box-has-an-int-id-and-an-east-and-west-side-these-are-represented-as-boole

(Solved): 2.Create a class box, each box has an int ID, and an east and west side, these are repre ...



2.Create a class box, each box has an int ID, and an east and west side, these are represented as Booleans, all of these are randomly assigned true or false. If true you can pass through that side. These are ONE WAY doors. If false it is a wall. Create a ROW of 8 random boxes. Determine which box has the maximum reachability. Use : to represent a door and a | to represent a wall in your display, example follows:

|0| :1|:2:|3:|4||5::6: |7:
Box 0 you can go no where
Box 1 you can visit 0 ((box 1 has a West door))
Box 2 you can visit 1 and 0 AND 3 and 4
Box 3 you can visit 4
Box 4 you can go no where
Box 5 you can visit 6 and 7
Box 6 you can visit 5 and 7
Box 7 you can go no where
The box with maximum reachability is box 2 where you can reach 0,1,3,4


We have an Answer from Expert

View Expert Answer

Expert Answer


#include <iostream>#include <vector>using namespace std;class Box{public:int
We have an Answer from Expert

Buy This Answer $4

Place Order