15-539 Week 2 Team Homeworks

Homework 2: Backend

Introduction to Java

Purpose

The backend team will be using Java this year. We understand that everyone here has a different background in Java, but we want to bring everyone up to a decent baseline before we start writing “real” code. The goal of this assignment is to get your understanding of Java fundamentals up to snuff.

This will be part 1 of 3 assignments that revolve around learning Java. Don’t worry - no one expects you to be a Java expert in 3 weeks. The goal is to introduce you to the basic concepts, so that as we go through review, you understand what we’re talking about. These assignments aren’t going to be exciting, but they will let us do very powerful things in the future.

Contents

Setup

We will be using IntelliJ and Gradle for our projects. You shouldn’t need to create projects yourself, but you should be able to load ours.

For now, install IntelliJ Community Edition, and Gradle. Clone Skunk Works on your computer, and open the “backend-hw2” project in IntelliJ to get started with the assignments below. Please do this on your own local branch, and do not push it to master.

To open the project in IntelliJ, open the application, then use “Open…” to open the backend-hw2 folder. When IntelliJ opens, you should see a notification titled “Unlinked Gradle Project?” Click the import link just below the title. On the dialog that opens, check the “Use auto-import” button, then hit “OK.” Next you’ll see one or more boxes that start with “The modules below are not imported…” Click OK on all of those too. It will take a few seconds for Gradle to sync and make the first build, then you should be good to go. If you can’t find files, open the “Project” window by going to View > Tool Windows > Project.

Reading

This is heavy reading. It’s going to take time and experience to understand how this all works;  no one expects you to understand this all next week. Hopefully, this information helps you develop a vocabulary for talking about OOP in Java.

A lot of this comes from Effective Java by Josh Bloch. It is not a book that teaches Java, instead it gives specific advice on how to write robust and maintainable Java code - just what we want to do!

PS - I linked to the CMU library version of Effective Java (EJ). If you need a PDF, let me know and I’ll send it to you privately (I don’t want to create a public Google Drive link to it).

Assignments

CodingBat (warm-up)

These assignments are only necessary if you are new to Java. I know all of you could solve these problems in short order in Python, so this is a perfect way to write some Java functions, getting used to the syntax and documentation, without worrying about difficult logic.

Fraction

Write a fraction class like fraction.py from 112 - but do it Java style! Implement an immutable Fraction class that implements Comparable interface. Be sure to override the equals and hashCode methods. Write tests for your fraction class, using JUnit, in the FractionTest.java file.

The homework should be done on your own local branch of the skunkworks repository. Once the deadline has passed, I'll ask you to push your local branch to GitHub to practice the review cycle.

Recipe

This exercise will help you to implement abstract classes that other people have written (you will also use your fraction class!). By implementing Ingredient subclasses (e.g. Flour, Water) and RecipeSteps (e.g. Mix, Bake), you can create a Recipe that will pretty-print what you materials you need for the recipe, and the steps to cook it.

Homework 2: UX Design

Due by Saturday, 9/7 at 11:59 pm:

Due by Wednesday, 9/13 at 11:59 pm:

Homework 2: Frontend/UX Implementation

Tetris using HTML + Javascript

Due Wednesday September 13 2017 at 11:59pm.

Reading

First read this tutorial to learn about HTML. You only need to cover the “HTML5 Tutorial” and the “HTML Graphics” sections. In the “HTML5 Tutorial” section you may skip everything below HTML Head.

Then read this tutorial to learn about JavaScript. Complete the “JS Tutorial”, “JS Objects”, and “JS Functions” sections.

Finally, read this tutorial to learn about CSS. Complete the “CSS Tutorial” up to the “Opacity” section.

Tetris

Write Tetris in Javascript (and the HTML canvas) using the 15-112 tutorial. We have included a file, sampleTetris.py and a version of eventBasedAnimation.py to help you get started. Your solution should be a single tetris.html file with all the JavaScript code in an inline script tag.

Bootstrap

First, spend 10 minutes reading (skimming) the Bootstrap docs.

Then, download the file named bootstrap.html. It has starter code that fetches dependencies. Your task is to produce (at least—you can do more if you want to!) 2 distinct widgets that are styled using bootstrap. What we mean by widget is a group of elements (i.e. buttons, textboxes) that together perform some basic functionality.

For example, 3 text boxes that take integer values from 0-255 and color a button could be one widget. Or a group of dropdowns that triggers a modal pop up.

Be sure to incorporate elements from the CSS, Components, and Javascript tab on the Bootstrap docs site.

Collaboration

You may find it helpful (and fun!) to work together for both inspiration and for sharing knowledge. Obviously, do not copy other students’ code. Please put who you worked with in a team.txt file, and limit the team size to 3 students.

Timesheet

As usual, please include a detailed timesheet, timesheet.txt, in your submission directory.

Help

Kenny (kdramos) and Lizzy (ejboard) have kindly offered to provide 1-on-1 help by appointment for HTML, JS, and CSS topics. Feel free to contact them to set up meeting times.

Handin

To submit your work, put the following files into a folder and compress it into a .zip archive, which can be submitted on Autolab.

Homework 2: Autograder

Homework 2: Graphic Design

Homework 2: Textbook

Homework 2: Accessibility

In addition to this week’s CS content and git training homework, you guys will also have some items to attend to as the accessibility team. We mentioned them during our meeting yesterday, but just to formalize what we expect and what you should include with your submission:

We think that this assignment should take roughly five to seven hours. If you find that you are spending significantly more than that, please email me. Have fun!

Homework 2: Video Team

Homework 2: Media Team

In addition to this week’s CS content and git training homework, you guys will also have some items to attend to as the media team. We mentioned them during our meeting yesterday, but just to formalize what we expect and what you should include with your submission:

We think that this assignment should take roughly five to seven hours. If you find that you are spending significantly more than that, please email me. Have fun!

Homework 2: Extended Framework

Find external APIs or Frameworks that are consistent with the 15-539 mission and showcase the following:

  1. How it fits into our goals. Making thoughtful comments as to why that thing would interest High Schools students or just about anyone that uses our website and what improvements could be made.
  2. How it could be integrated into a website (for week two we do not have a website to integrate to so you will just generalize).
  3. Come up with your own ideas! Write down a couple of ideas that are out there and sound awesome. Expand on it, what would we do with it? how would having it make the website more appealing?

Include links to any projects or additions you looked at.

Homework 2: CS Pedagogy & Competitive Analysis

In addition to this week’s CS content and git training homework, you guys will also have some items to attend to as the competitive analysis team. We mentioned them during our meeting yesterday, but just to formalize what we expect and what you should include with your submission:

We think that this assignment should take roughly five to six hours. If you find that you are spending significantly more than that, please email me. Have fun!