Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Ruby) Create a class, School, that can be initialized with a name. The School class would be referred to as a model in the domain

(Ruby)

Create a class, School, that can be initialized with a name. The School class would be referred to as a "model" in the domain model context.

A school should have a roster. The roster should be an empty hash upon initialization but will be built out to contain keys of grade levels. The value of each key will be an array of student names.

You should be able to add a student to the school by calling the add_studentmethod and giving it an argument of the student's name and their grade.

A method, grade, should take in an argument of a grade and return all of the students in that grade

You should be able to get a sorted list of all the students where the strings in the student arrays are sorted alphabetically.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory Icdt 99 7th International Conference Jerusalem Israel January 10 12 1999 Proceedings Lncs 1540

Authors: Catriel Beeri ,Peter Buneman

1st Edition

3540654526, 978-3540654520

More Books

Students also viewed these Databases questions

Question

Employ effective vocal cues Employ effective visual cues

Answered: 1 week ago