Thank you for agreeing to take part in this experiment. Do NOT write your name on the paper. It is intended that the results be anonymous. This experiment is part of a study looking at how developers allocate information between different structure types. Background information about you:

    a)  How many lines of code would you estimate you have written, in total, over your career:

        i)  50,000

        ii) 75,000

        iii)
            100,000

        iv) 150,000

        v)  200,000

        vi) 275,000

        vii)
            350,000+

    b)  How many lines of code would you estimate you have read, in total, over your career:

        i)  75,000

        ii) 100,000

        iii)
            150,000

        iv) 200,000

        v)  300,000

        vi) 500,000

        vii)
            800,000+

    c)  How many years have you been writing software professionally?
What you have to do You will be asked to define some data structures to hold values for various kinds of information. This is not a race and there are no prizes for providing answers to all questions. If you do complete all the questions feel free to add any additional comments to your previous answers. Yumei is a medium sized island that gained independence in 1945. The island economy is based on the export of a various kinds of raw materials and agricultural products. The government has decided to publish a set of APIs that applications written for government departments must follow. The government could not reach consensus on an object oriented approach and it was decided to specify data types and access functions separately. You have been assigned the job of creating the data structures that will be used to hold various kinds of information. If possible please briefly specify any rationale used to decide how to organise the data structures. The declarations can be written in a language of your choice (it would simplify subsequent analysis if either C or Java were used). The members may have any arithmetic type, or a pointer type, or an array type.

    1)  Read the information that needs to be represented.

    2)  Decide which information should be held in a given data structure.

    3)  Decide on a type to be used to represent the value of the information.

    4)  Decide on the name of a member to be used to denote the information.

    5)  Define one or more structure types to hold members denoting the information.

The Department of Housing maintains rented accommodation for workers. The form of accommodation can be one of: Bungalow, Caravan, Dormitory, Flat, House, Youth hostel The information, about the accommodation, that needs to be processed by applications includes the following (in alphabetical order):

    1)  Address of accommodation

    2)  Detached, Semi-detached, Terraced

    3)  Easily moved

    4)  Floor number of accommodation

    5)  Name of current responsible occupant

    6)  Name of given town

    7)  Number of bathrooms

    8)  Number of bedrooms

    9)  Number of each kind of accommodation in given town

    10) Number of rooms

    11) Parking space included with accommodation

    12) Shared bathroom

    13) Size of garden

    14) State of repair

    15) Total area of floor space

    16) Total value of each kind accommodation in given town

    17) Weekly rent

#define HOUSE          0
#define BUNGALOW       1
#define CARAVAN        2
#define FLAT           3
#define DORMITORY      4
#define YOUTH_HOSTEL   5
#define MAX_ACCOM_KIND 6
#define NOT_APPLICABLE 0
#define DETACHED       1
#define SEMI_DETACHED  2
#define TERRACED       3
struct town_accommodation {
           char * town_name;
           int num_accom_kind[MAX_ACCOM_KIND];
           float value_accom_kind[MAX_ACCOM_KIND];
           };

struct accommodation {
           int kind_of_accommodation;
           int num_rooms;
           int num_bedrooms;
           int num_bathrooms;
           float garden_size;
           float weekly_rent;
           int detached_status;
           char easily_moved;
           char shared_bathroom;
           char has_parking_space;
           int floor_number;
           char * address;
           char * repair_state;
           char * current_occupants;
           };
typedef unsigned char BOOL;
struct caravan_rec {
           int number_of_rooms;
           int number_of_bedrooms;
           int number_of_bathrooms;
           float size_of_garden;
           float rent_per_week;
           BOOL bathroom_is_shared;
           BOOL parking_space_available;
           int floor_number;
           char * address;
           char * state_of_repair;
           char * current_occupiers;
           };
struct accommodation_rec {
           int accommodation_kind;
           int number_of_rooms;
           int number_of_bedrooms;
           int number_of_bathrooms;
           float size_of_garden;
           float rent_per_week;
           int detached_status;
           BOOL bathroom_is_shared;
           BOOL parking_space_available;
           int floor_number;
           char * address;
           char * state_of_repair;
           char * current_occupiers;
           };