• High Score

    At the end of this problem you should submit to Laulima (please zip these files to work around the 5 file limit):

    • a file named UHusername_display_highscore.c
    • a file named UHusername_display_highscore.h
    • a file named UHusername_display_highscore_constants.h
    • a file named UHusername_display_highscore_helpers.c
    • a file named UHusername_display_highscore_helpers.h
    • a file named UHusername_display_highscore_setup.h

      example:

      • zhaol_display_highscore.c
      • zhaol_display_highscore.h
      • zhaol_display_highscore_constants.h
      • zhaol_display_highscore_helpers.c
      • zhaol_display_highscore_helpers.h
      • zhaol_display_highscore_setup.h
    • Update the display program that you completed from Lab 09

      It will be beneficial for you to leave your previous lab work untouched by copying them to a new folder for this lab and modify only the files in the new folder

      If you were not able to complete Display with Attacker and Teleport from the Lab 09, you can modify a fresh copy of the display program. The feature set between both lab assignments are independent. Just follow the download instructions from Lab 08 and coordinate with your lab instructor.

      Update your Display with Attacker and Teleport program from Lab 09 to add the following features:

      1. Implement a high score feature:

        • each time the token moves "on top" of an item, increment the score by 1
        • when an attacker moves "on top" of the token, the game ends
        • when the game ends, the current score is compared with the high score
          • the high score is read/written to a file for persistence, i.e. the high score can be retrieved after the program ends
          • if the current score is greater than the high score, then the program will ask the user for his/her name and stores the user's name and high score to the file
        • if you were not able to get the item and attacker to work, then:
          • increment the score each time the token is at one of the 4 corners of the screen
          • the game ends when the token is at a particular "trap" position, you can choose the "trap" position or make the "trap" position be random
  • Uber

    Uber is a rideshare company that started in San Francisco, California. We will be analyzing a subset of their data that was previously hosted at InfoChimps

    Download the modify Uber data

    You can download the dataset with any of the following methods:

      Using GIT (recommended):
    • cd into your lab folder
    • issue these command at the command prompt:
      • git clone https://github.com/zhaol/datasets.git
      • cd datasets
      • git checkout tags/uber.1.0.1
      Manually copying and pasting the files:
    • all the necessary files are listed here: https://github.com/zhaol/datasets/tree/uber.1.0.1
    • when copying and pasting the file content, be sure you are copying and pasting the contents of the files for version uber.1.0.1 (you should see "tag: uber.1.0.1" in the top left area)

    No matter which method you choose, be sure the version.txt file says:

    uber.1.0.1
    
    Lab 10:
    Count the number of rides
    Calculate the distance travelled for each ride

    To understand the data:

    The data file is explained in the README of the dataset (this links to a copied version of the original data because the original dataset has been removed from the InfoChimps)

    Essentially, it is:

    trip_idtabiso_timestamptablatitudetablongitude

  • Uber Ride Count and Distance

    At the end of this problem you should submit to Laulima (please zip these files to work around the 5 file limit):

    • a file named UHusername_uber_ridecount_distance.c
    • a file named UHusername_uber_ridecount_distance.h
    • a file named UHusername_uber_ridecount_distance_constants.h
    • a file named UHusername_uber_ridecount_distance_helpers.c
    • a file named UHusername_uber_ridecount_distance_helpers.h

      example:

      • zhaol_uber_ridecount_distance.c
      • zhaol_uber_ridecount_distance.h
      • zhaol_uber_ridecount_distance_constants.h
      • zhaol_uber_ridecount_distance_helpers.c
      • zhaol_uber_ridecount_distance_helpers.h
    • Write a program that will analyze the Uber data to do the following:

      1. determine the number of rides in the data set:

        • do not just use the ID column for this; there is no guaratee that the IDs are in sequential order and are not skipped within the data set
          for instance, don't assume there are 5 rides by looking at the last ride ID, because the data could have 4 rides and look like this:
          1
          1
          1
          3
          3
          3
          4
          5
          5
          
      2. determine the start-to-end displacement for each ride:

      3. output the number of rides and displacement for each ride to an output file, uber_ridecount_distance_output.txt

    • Things to note:

      • To help with visualize your data, you can use this web application

      • A lot of the programming that engineers do will relate to processing data. Typically, an engineer will analyze performance data before and after a proposed change to help make a decision on whether or not to move forward with the change. Even though it is not as fun as making games, it is definitely a worthwhile skill to aquire. Luckily, there are other languages available that have more support for data processing. The C programming language really shines when working with hardware (e.g. robotics, electronic gadgets, etc.)