Question: In PHP, Objectives: More familiar with PHP Syntax Use object-oriented code to structure concepts Read from API Transform raw data into objects you can interact

In PHP,

Objectives:

  • More familiar with PHP Syntax
  • Use object-oriented code to structure concepts
  • Read from API
  • Transform raw data into objects you can interact with
  • Interact with a collection of objects for meaningful reporting
  • Get more familiar with PHP syntax and built-in functions
  • Use Illuminate\Support library (Collection, Arr, etc.) to powerfully interact with our data
    • Looking through the available methods may very likely make this assignment implementation a ton easier. :)
  • Organize classes into their own files

Coding Standards and Clean Code

  • Meaningful variable, function, namespace, class, method names - spell them out and don't abbreviate. (For example, $firstName instead of $fn. $StudentProfile instead of $StProf.)
  • Put classes into their own files
  • Use logical indentation for code blocks (e.g., PHP formatter)

Description:

Important links:

  • Read about data youll be consuming from https://data.wa.gov/Demographics/WAOFM-Census-Population-and-Housing-2000-and-2010/tx5i-i2ja (Links to an external site.)
  • The specific data API endpoint youll be consuming from (from your code) is here: https://data.wa.gov/resource/ktqk-i4iw.json (Links to an external site.)

Write a command-line/terminal application that reads in city census data from listed API endpoint (see above). Read data in, convert data into City objects. The only json fields to be captured and stored in an object are: place_name and total_population_2010.

Then print a report:

  • 10 highest populated cities (ordered from high to low)
  • 10 lowest populated cities (ordered from low to high)
  • A random city

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!