Author Archives: Mr. M

Supa Web Programming 2016-17

Quarter 3

NOTE: if you were in CS II last year, you *must* use Option 1, unless you get permission from me.

  1. PHP
    1. Option 1 : PHP for Web Designers link
    2. Option 2: PHP with Mysql Essential Training link

You should use Option 2 if you either a) feel confident in your programming background or have experience programming outside of the class 2) took the AP class last year.

SKIP Installation unit except for Configuring php

 

Full assignment breakdown here 

 

 

Below are some courses that you can explore as you consider ramping up your skills for the 4th quarter independent study.

Further study in PHP .

  1. PHP and MySql beyond the basics (link) . Pre-req for the MVC patterns. This shows you how to use OOP, something I’d recommend for the AP students. Most MySql connections now require OOP(object oriented programming)
  2. MVC pattern for php applications link  . Note Laravel is, by far, the most respected framework . At the end, I would recommend using Laravel. If not, try codeigniter
  3. PHP and Ajax Good for anyone interested in modern websites . Or for more interactive games
  4. Creating Secure Websites (link)

HTML5/Javascript Games

  1. Learn how to use the most popular game framework, phaser.io, with this video : https://www.lynda.com/Phaser-tutorials/HTML5-Game-Development-Phaser/163641-2.html
    1. Making Asteriods with Phaser (link) . Asteriods is a classic “first game”. You would need to make more than just a single game, but it would be a good start.

 

Quarter 4

This quarter will be comprised of an extended independent project that can be focused on anything web related. Note: If you are taking next year’s AP class, you must choose a rigorous programming project.

a) choosing a long term project that requires extended learning.  At least 1-3 Lynda.com classes (I will need to see that you completed 100% of at least 1 class)

b) you must write a proposal that details

  1. what the final product will be
  2. What new skills/learning you will undertake to achieve this new product
  3.  what Lynda course(s) you will study to learn the skills from #2

Methods , Variables, Functions Alice 2 Projects

 

#1  Apollo 15 :

screenshot.235

 

During the Apollo 15 mission to the moon, astronaut David Scott performed an experiment to prove that Galileo was right when he said that any two objects dropped at the same time would land on the ground at the same time in the absence of air. Scott, standing on the surface of the moon, dropped a hammer and a feather and indeed both objects hit the ground simultaneously.(Again, you must use “do together”)

Create an Alice world that recreates the experiment. You will find classes for the astronaut, lunar Lander, and the moon’s surface in the Web gallery’s Space collection. You can find a class for the Hammer in the Objects collection. Substitute any object of your choice for the feather.

Note : for following 3 steps, see Example 1 below

  1. Create a variable called  dropDistance
  2. set the value of this variable to the returned value of a distance function to make the objects fall the distance to the ground. (If stuck, read this )
  3. Make the two objects fall down the value of the distance

Example 1 (help with steps 2-4)

Steps 2-4 are similar to what is happening in the following picture :

screenshot.7

 


#2 Space Ship Repair :

spaceship-repair-demo-2

Create a space world with an astronaut and two spaceships(from the Web gallery’s Space collection). One of the spaceships is stranded with engine trouble, and the astronaut has arrived in the other spaceship to perform a repair.

  • The astronaut should initially be positioned just outside one of the spaceships, about to perform a space walk to the other ship. When the world is played, the astronaut should initially be positioned just outside one of the spaceships, about to perform a space walk to the other ship.
  • create a variable called walkingDistance ( to hold the distance that the astronaut must walk)
  • set the value of walkingDistance  to the returned value of a a proximity function  . (If stuck, read this ).  Here are some tips on using proximity functions in Alice 2.0.
    • NOTE: It turns out that, in this case, the best proximity function to use is distance to .
  • When the world is played, the astronaut should float to the stranded spaceship, appear to work for a few moments, and then float back to the rescue ship.
  • The repaired ship should then fly away, off the screen.

#3 Drag Racing:

spaceship-repair

 

  • Use  at least 1 set of comments
  • Create a world with a road (from the City collection) and two cars (from the Vehiclescollection).
  • Resize the road as necessary to match the size of the cars. The cars should be lined up side by side at one end of the road, which is a drag strip.
  • When the world is played, the cars should simultaneously move to the other end of the road and stop(You must use “do together”).
  • Change the duration of the method call that you use to move one of the cars so it is faster than the others.
  • Position the camera so you can see the cars as they approach the end of the drag strip.
  • Put an object at the end of the race to signify the ‘finish line’ and use a proximity function to move the cars to the end.

drag-racing-2


#4  Open Ended Project

  • Two or more objects
  • Must tell some kind of story
  • use at least 1 variable
  • use at least 1 function

bolivar_open_proj_penguin_ball cwong_open_proj_tag

Limitations of Inheritance

why Interfaces Are Useful

We are going to write a class that sorts some of the classes we have already written –namely : the Account and Student classes that we wrote in the past. Specifically, this class is going to sort Student and accounts by their grade point averages and their account balances , respectively..

Organizer Skeleton class (You only have to fill in 1 method)

Class : Organizer

The Constructor

  • The constructor is completely written for you already. It creates an array of Accounts and an array of Student. It also sends the arrays to both of the sort methods described below. You only need to write 1 method : public static void sort (Student[] arr) which is described below.

Accessor Methods

  • Sort Methods
    • public static void sort(Account [] arr)// Implemented this for you
    • public static void sort (Student[] arr) //basically…modify the sort method above so that it works for the Student class by comparing how old they are

What if we wanted to sort the PlayList class and add the method void sort(PlayList[] lists)?

Answer: We’d have to yet again add a whole new method that is very similar to the two sort methods we already wrote

Final Alice Assignment

This is your “cumulative Assignment”

  • It must tell a story
  • Minimum of 5 objects

 

Programming Requirements

  • Some kind of interactive event (#27) . Something should happen when a mouse is pressed, key is pressed etc

 

10 points of the following

 

  • Loop    (2 points )
  • variable (1 point)
  •  function (1 point)
  • custom object (save to file etc)  2 points

Alice Unit 5

5.1: Exercise Competition:

excercise_competition_emo

Three girls Jenny, Kelly, and Barb are enrolled in an exercise class. One day after class the three decide to have a friendly competition to see how many sets of 10 repetitions of running in place each can do before getting tired. Barb decides to go first and gets tired at 10 repetitions. Kelly goes next and she gets tired at 20 repetitions. Jenny, who has been in the exercise class for the longest, goes next. She gets tired at 30 repetitions.

Create a world that suites the competition.

  • Note: Basically, you are just using a parameter to determine how many times the girl “runsInPlace”
  • Important: Each of the girls should be an instance of ExerciseGirl class that you created in chapter 5.

 

excercise compe


 

EACH Assignment below requires the use of a parameter in some way.  If you do not have a parameter, as described, you will lose a lot of credit.

 

Here is a helpful link on how to create and use parameters, in case you forget.

 


5.2 : Jumping Jacks

jumping-jacks-optimized

Add a jumpingJack method to the ExerciseGirl class. The method should make the object perform jumping jacks .

  • Important: this method should have a parameter for the number of repetitions to perform.

5.3 : Marcello The Magician:

 

Marcello the magician has finally mastered his disappearing act. To perform the act, he places several items on a table in front of him. He stands with his right arm extended over an item. He says the magic word “Alakazam, Alakazee” and the object disappears. He repeats this procedure for each object on the table. Create a world in which Marcello (an instance of the Magician class from the People Collection) demonstrates his new act . In the magician object

  • you should create two new class-level methods:
    • sayMagicWords
      • should cause Marcello to say the magic words.
    • makeDisappear
      • This method should have an object as its parameter
      • should cause Marcello to turn to face the object, say the magic words (by calling the sayMagicWords method) and then make the object disappear by setting its opacity to zero (note: for some reason the bunny object cannot be made to disappear this way!).
  • gigantaicize
    • This method should have an object as its parameter
    • the object should be made to 5 times its original size!
  • Want to get an “A+”: then create a transmute method tha
    • takes an object  parameter
    • Changes a locust to a boar (hide the one , make the other appear)
    • changes a bird to a locust

ALice Loop Assignments

ezgif.com-optimize

1)  Centigrade to Fahrenheit Modification: Modify the Fahrenheit to centigrade project as follows.

  1. Let the user do as many centigrade modifications as you want (like this link here)
  2. Then use a loop to do that many conversions

2) Miles Per Gallon Modification: Modify the miles per gallon projec. In this one, ask the user how many times they want the MPG program to run and use a loop like this. .Due wed/Thurs the 17th/18th

  1. Ask the user how many times, they want to do the MPG and use a loop like this
  2. Then use a loop to do that many conversions

3) Sea Plane Loop-the-Loop : Create a world with a sea plane (from the Vehiclescollection).Create an infinite loop that causes the sea plane to do a circular loop the loop. Adjust the style and duration editing tags to make the animation fast, and as smooth as possible.


EOU)  Open assignment. Your open project must have each of the following criteraDue before Winter vacation

  1. a variable
  2. store the return value of a function into that variable
  3. a loop of some kind

Objects In Java Unit

 

Unit 4  Objects && ArrayList

Unit 5 : Objects Continued