###Hello Review Session!
Below I have included a fairly complex hash called 'us_government' the following questions will be about going through this hash. Write the code that answers each of the questions below.
- Return an Array of of the names of all the Supreme Court Justices
- access the hash with the name attribute "Senator 18"
- Print out the names of all the Representatives to the console
- Return an array with the names of all members of the government
- Remove "Senator 6" from the hash
- Add "Representive 20" to the house of representatives
- make the Supreme Court members an array of strings instead of an array of hashes
- Add the cabinet, with all it's members to the executive branch
- Add a favorite color for all house representatives
- Give each hash in every ":Member" array a "children" key that has a value with an array with a random number of kid hashes(no more than 10). Give them arbitrary names like "Kid 1." ex. {:name => "Kid 6"}
- Replace A Supreme Court Justice of your choice with "Super Man"
- Return three, seperate hashes, one for each branch of the governmnet
us_government = {
:branches =>
[
{:name => "Judicial", :organizations =>
[{:name => "Supreme Court", :Members =>
[{:name => "John G. Roberts, Jr"},
{:name => "Antonin Scalia"},
{:name => "Anthony M. Kennedy"},
{:name => "Ruth Bader Ginsburg"},
{:name => "Stephen G. Breyer"},
{:name => "Samuel Anthony Alito"},
{:name => "Sonia Sotomayor"},
{:name => "Elena Kagan"},
{:name => "Sonia Sotomayor"},
{:name => "Clarence Thomas"}
]
}
]
},
{:name => "Executive", :organizations =>
[{:name => "President", :Members =>
[{:name => "Barack Obama"}]
},
{:name => "Vice President", :Members =>
[{:name => "Joesph Biden"}]
}
]
},
{:name => "Legislative", :organizations =>
[{:name => "Senate", :Members =>
[{:name => "Senator 1"},
{:name => "Senator 2"},
{:name => "Senator 3"},
{:name => "Senator 4"},
{:name => "Senator 5"},
{:name => "Senator 6"},
{:name => "Senator 7"},
{:name => "Senator 8"},
{:name => "Senator 9"},
{:name => "Senator 10"},
{:name => "Senator 11"},
{:name => "Senator 12"},
{:name => "Senator 13"},
{:name => "Senator 14"},
{:name => "Senator 15"},
{:name => "Senator 16"},
{:name => "Senator 17"},
{:name => "Senator 18"},
{:name => "Senator 19"}
]
},
{:name => "House of Representatives", :Members =>
[{:name => "Representative 1"},
{:name => "Representative 2"},
{:name => "Representative 3"},
{:name => "Representative 4"},
{:name => "Representative 5"},
{:name => "Representative 6"},
{:name => "Representative 7"},
{:name => "Representative 8"},
{:name => "Representative 9"},
{:name => "Representative 10"},
{:name => "Representative 11"},
{:name => "Representative 12"},
{:name => "Representative 13"},
{:name => "Representative 14"},
{:name => "Representative 15"},
{:name => "Representative 16"},
{:name => "Representative 17"},
{:name => "Representative 18"},
{:name => "Representative 19"}]
}
]
}
]
}