Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The codebase includes several files: heap.h: The header for the heap template. You will implement the needed heap functions and any others you feel you

The codebase includes several files:

heap.h: The header for the heap template. You will implement the needed heap functions and any others you feel you need. You can use the Standard Library, but none of its heap functions (std::make_heap, std::push_heap and std::pop_heap).

candidate.h/candidate.cpp: Code for representing the immigration candidate. Each candidate instance has several variables of note:

age: The age, from 18 to 100.

isMarried: A flag indicating if the candidate is married. We do not track if the spouse is in the pool (real countries do).

numChildren: Number of children from 0 to 10.

money: Money on hand, in local currency.

edLevel: A enumeration type representing the education from less than High School (primary) to PhD level (terminal).

langLevel: A measure of language fluency from 0 to 10 (higher, better).

healthFlag: A flag representing if the candidate has a major health issue.

hasJob: A flag representing if the candidate has a job in the new country.

priority.h/priority.cpp: The code for different priority algorithms. Canadia(const candidate&) implements the Canadia policy; Thanos(const candidate&) implements the Thanosian policy. You will need to implement one of your own and report its results as well.

driver.cpp: The driver. You will need to modify this to include a test of your own policy.

Note that the algorithm for generating a random candidate is entirely random, make generate some non-sensical candidates (the 20 year old with 10 kids and a MS degree), and has no basis in demographics.

You will need to implement the heap data structure for this assignment. In addition, you need to create and test your own policy for immigration and report on its results; see below for the details.

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions