Starting from:

$15

Assignment 7  Solution

Create a folder named assignment7 in your development environment.

Write a PHP script that contains an object to store information about a vehicle. The vehicle must have at least four properties, one being direction which will have a value between 0 and 360 degrees. Add two methods called left and right which when invoked will subtract or add 10 degrees respectively to the direction property.

Instantiate two variables of the object and display a web form showing the properties for both instances of the vehicles instantiated. Add buttons to the form to execute the two methods (left, right) defined for each instantiation. When a button is pressed, update the respective object instantiation and redisplay the web form.

Hint: Create a method in the object to return all the properties in an associative array and then save and read the array from the session to instantiate and apply methods.

The layout, color choices, use of HTML/CSS and aethetics of the web page(s) created will be used in calculating your grade.

More products