Reference no: EM13333349
In this assignment you will develop an animated application that uses linked lists as the basis of the implementation. This application builds on the application that you worked with for tutorial 3.
Go to Stream and download the files
caterpillar.py
my_catclass.py
Set up a new project in Eclipse and add these files to it.
caterpillar.py is a program that implements the beginnings of a simple graphical animation. When you run this program, you will see a screen, 1000 pixels wide by 400 pixels high, displaying a basic background scene with a 'caterpillar' anchored at random location. To begin with, the caterpillar just has a face, no body parts.
Similar to the application that you worked with in tutorial 3, on each iteration of the main program loop we check to see if the user wants to quit, or if he has pressed the spacebar, or one of the 'm', 'd' or 's' keys, each of which initiates a different response (full functionality is described later.) After that, we update the screen by redrawing the background scene and the caterpillar. The drawing methods for the background and the caterpillar have been provided for you.
The module my_catclass.py, which is imported into caterpillar.py, implements a linked list based implementation for a caterpillar object. The caterpillar class is expanded from the class used in the tutorial.
Now, a caterpillar consists of the following components:
- face_xcoord and face_ycoord - horizontal and vertical coordinates for the face. These coordinates are used by the draw_face(screen) method to give the location of the top left boundary of the graphic that represents the caterpillar's face.
- body - a reference to a segment_queue object. A segment_queue is a linked list of body_segment nodes that makes up the caterpillar's body. A segment_queue has head and last references, just like the Improved linked Queue class shown in lectures. A body_segment(x, y) object consists of x and y coordinates, giving the location of the top left boundary of the graphic representing the segment; and a reference to the next body_segment in the list.
- travel_direction - a string representing the current direction of travel for the caterpillar, either 'left' or 'right'.
- food - a reference to a food_list object. A food_list is a linked list of food_item nodes that makes up the caterpillar's food. A food_item(x, y, kind) object consists of a string representing the foodtype, either 'nice' or 'nasty'; x and y coordinates, giving the location of the top left boundary of the graphic representing the item; and a reference to the next fooditem in the list.
Compute the ratio of income taxes to income earnings
: Which is the largest expense for each company in the most recent year? What is its dollar amount? Is it logical that this would be the largest expense given the nature of each company's business? Explain your answer.
|
Determine what is the break-even quantity per unit
: Shapland Inc. has fixed operating costs of $350,000 and variable costs of $60 per unit. If it sells the product for $70 per unit, what is the break-even quantity
|
Explain how reported accounting numbers might affect
: Explain how reported accounting numbers might affect an individual's perceptions and actions. Cite two examples.
|
Develop an animated application
: In this assignment you will develop an animated application that uses linked lists as the basis of the implementation. This application builds on the application that you worked with for tutorial 3.
|
What would be the total increase in the gdp
: Given an increase in spending of $1,000, and a Marginal Propensity to Consume of 80% (8/1 0), what would be the total increase in the GDP (as a result of the Multiplier?) What would the Multiplier be? Show your work.
|
Determine what is the companys cost of equity capital
: David Ortiz Motors has a target capital structure of 45% debt and 55% equity. The yield to maturity on the company's outstanding bonds is 9%, and the company's tax rate is 40%.
|
Divorce case knowledge that the wife is pregnant
: Under our statue requiring that a petition disclose whether there are any children under ages of 16, making it obligatory upon the court to make such orders respecting custody and support as is best for the child or children, is an attorney guilty of..
|
Financial reporting environment for the quarter
: Prepare a 2 page newsletter that identifies and summarises developments and changes in the financial reporting environment for the quarter from January to March 2013.
|