Job Opportunities   Learning O

 

Job Opportunities

 

Learning Objective

In this lab, you will practice:

  1. creating a dictionary and accessing its elements
  2. nested If conditions
  3. creating a function with a return statement

Instructions

Main Idea

Assume there is a job finding agency and they can get you a job based on your age and height. You will create a function that takes the age and height as parameters and returns the department in which you will be working at. Finally, you will get the working hours per week from a dictionary. In this dictionary, the department is the key and the number of working hours per week is the value

Steps

  1. Input from the user the age (integer) and height in cm(float)
  2. Create function get_department that takes the age and height as parameters and returns the department as follows:

if age greater than or equal to 20 and age less than 40:

  • If height greater than or equal to 150 and height less than 170: the department should be “Human Resources”

  • If height greater than or equal to170 and height less than or equal to180: the department should be “Marketing”

  • Otherwise: the department should be “Sales”

If age greater than or equal to 40 and age less than or equal 60:

  • If height greater than or equal to 150 and height less than 170: the department should be “Finance”

  • If height greater than or equal to 170 and height less than or equal to 180: the department should be “Administration”

  • Otherwise: the department should be “R & D”

Otherwise: the department should be “IT”

  1. Create a dictionary with the departments as keys and the working hours as values. Below are the details for the keys and values:

    • “Human Resources” : 20
    • “Marketing” : 30
    • “Sales” : 30
    • “Finance” : 25
    • “Administration” : 22
    • “R & D” : 40
    • “IT” : 35
  2. After you get the department from the function, get the working hours from the dictionary and print the following statement with the substitution for AGE, HEIGHT, HOURS, and DEPARTMENT with their corresponding values:

My age is AGE and my height is HEIGHT. I work HOURS hours per week in DEPARTMENT.

Example

Input

23 166

Output

My age is 23 and my height is 166. I work 20 hours per week in Human Resources.

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more