ISY00245 - Principles of Programming Assignment

Assignment Help Programming Languages
Reference no: EM132460628

ISY00245 - Principles of Programming Assignment - Southern Cross University, Australia

Green Foot Assignment - Programming Portfolio

Activity R4-2

Q1) Declare a variable called children of type int. Then write an assignment statement that assigns to this variable the sum of two of variables named daughters and sons.

Q2) Declare a variable named area of type int. Then write an assignment statement that assigns to area the product of two variables called width and length. Remember that the multiplication operator in Java is.

Q3) Declare two variables x and y of type int. Assign the values 23 to x and 17 to y. Then write some code to swap those values (so that afterwards x contains 17 and y contains 23). BE CAREFUL NOT TO LOSE THE VALUES while you are doing this!

Activity R4-3

2) The Greenfoot class has a method to get the noise level from the computer's microphone. Find this method in the API documentation. How many parameters does it have?

3) What is the return type of this method? What does this tell us?

4) What are the possible values returned from this method?

5) Is this method static or not? What does that tell us?

6) How do we call this method? Write down a correct method call to this method

7) In your stickman scenario, make the stickman move to the RIGHT, so that when you run your scenario, he walks over to the right side of the screen. Note: no keyboard input is required.

Activity 6-3

1) Write down the signature for the three methods.

2) Write down an example of a call to the setLocation method.

Activity R7-1

1) Declare and initialize a String array called names with the names of three of your classmates, or if you are an Online student, three of the names from one of the lectures

2) Write the code that will play a sound "ouch.wav" 20 times, using a while loop.

3) Consider the following code:

int x = 3;

int i = 0;

while (i < 3)

{

x = x + 1;

i = i + 1;

}

What is the value of x after this code has executed? Place your answers to this exercise in your portfolio document under the heading.

Activity R7-2

1) Open the scenario called bubbles. You will see that the world is empty. Place some Bubble objects into the world, using the default constructor. Remember you can also do this by shift-clicking into the world. What do you observe?

2) What is the initial size of a new bubble?

What is its initial color?

What its initial direction of movement?

Activity R8-1

1) Declare and initialise a String array called names with the names of three of your classmates, or if you are an Online student, three of the names from one of the lectures.

2) Write the Java/Greenfoot code (not in Greenfoot itself) that will loop through this array, showing each of the names using the showText method, in a different location each time.

3) Write a loop that will add the even numbers from 2 to 2000.

4) Write a FOR loop that will display the numbers from 199 down to 100.

Activity R9-7

Module 9: For-Each Loop

I have implement a simple scenario with class ant. Then I added a few ant objects to the scenario and used a list collection to store them in a single list. Then to set a random direction for each ant to stimulate ant movement I used the For each loop to iterator through the list and thus setting each ant with random direction. For each loop is very useful to iterator though an array or any other collection.

Module 10: Overloading Constructors

These are the constructors defined for the leaf object, using these leaf class object can be instantiated with different property so they can act like different objects in the game.

The first constructor public Leaf() creates a normal leaf object.

The second constructor public Leaf(int val) creates  a  normal leaf object with given value to the lead.

The third constructor public Leaf(String type) creates a leaf object with different setting based on the type string value.

This is demonstrates constructor overloading, as based on the number and type of parameters passed to the constructor the relevant method is invoked and the object is created by that constructor.

Reference no: EM132460628

Questions Cloud

Explain how financial institutions act as delegated monitors : Explain how financial institutions act as delegated monitors. What secondary benefits often accrue to the entire financial system because of this monitoring pro
Calculate the repricing gap and the impact on net interest : Calculate the repricing gap and the impact on net interest income of a 1 percent increase in interest rates for each of the following positions:
Calculate steves income assuming uses variable costing : Calculate Steve's income assuming he uses variable costing. Calculate Steve's income assuming he uses absorption costing.Steve's Burgers makes burger patties
What is the price of the bond : Consider a five-year, 15 percent annual coupon bond with a face value of $1,000. The bond is trading at a market yield to maturity of 12 percent.
ISY00245 - Principles of Programming Assignment : ISY00245 - Principles of Programming Assignment Help and Solution, Southern Cross University, SCU, Australia. Green Foot Assignment - Programming Portfolio
Prepare jornal entry for concord property management inc : Prepare jornal entry for Concord Property.Record the journal entries associated with the above transactions including any necessary entry at December 31, 202
Calculate the yearly returns of a portfolio : Calculate the yearly returns of a portfolio created by allocating your money 30% in share A and 70% in the market portfolio.
What do the respective changes in bond prices indicate : Consider a 12-year, 12 percent annual coupon bond with a required return of 10 percent. The bond has a face value of $1,000.
What is the effective annual rate : They allow you to pay back in monthly installments of $1,528 for three years. What is the effective annual rate (EAR) that they are charging you?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd