15b_Assignment_2

15b_Assignment_2 - Assignment 2 - Arrays in Classes Select...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment 2 - Arrays in Classes Select one option from the four below. All options are worth the same number of points. The more advanced options are provided for students who find the basic ones too easy and want more of a challenge. Make sure you have read and understand the Modules Information About Programming Assignments and Style Rules for Assignments before submitting this assignment. Hand in only one program, please. OPTION A (Basic): Sorted Property Listings From last week's Property class build an array of properties. Add a static method to the Property class: ListAll(Property property_list[], int num_properties, string key_field) -This will list the array, property_list, sorted based on the argument, key_field, passed in. These are the legal choices for key_field : "byPrice" "byNumRooms" "byDaysOnMarket" any other string should result in an error and nothing should be listed. HINT : For those of you who are rusty on sorting (a topic from CIS 15a), you can review this topic in Week 3, which is open to you now. You will have to create an instance method to the Property class, compareTo() with the signature. int Propertly::compareTo(Property prop, string key_field)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

15b_Assignment_2 - Assignment 2 - Arrays in Classes Select...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online