COMP1400 – Programming for Designers

Class announcements for Programming for Designers

COMP1400 – Programming for Designers random header image

Entries Tagged as 'Lab'

Tut Wk 11 – Wumpus

October 1st, 2012 · No Comments · Lab

Download the Wumpus game shown in lectures. Examine the code try to follow how it works. Make the following changes to the game: Rearrange the rooms so that are in a 4×5 grid. Make it so that the wumpus needs to be shot more than once (you choose how many times) to be killed. Each […]

[Read more →]

Tags:

Long weekend and Tut 11

September 25th, 2012 · No Comments · Lab

If you are in one of the Monday tutorials, your usual class will not be running next week as it is the long weekend. You are welcome to turn up to one of the other tutorial times: Tue 10:00 – 12:00 Mabu Lab Elec Eng 455 Tue 14:00 – 16:00 Leaf Lab Mech Eng Undercroft […]

[Read more →]

Tags:

Tut Wk 10 – Scrabble

September 23rd, 2012 · No Comments · Lab

Consider the game of Scrabble. List all the data involved in representing the game. Be thorough. How might this data be divided into abstract chunks? What idea does each chunk represent? Draw a flow chart of the game play. Break it up into methods of different levels of detail. How do these methods associate with […]

[Read more →]

Tags:

Tut Wk 9 – Classes and Lists

September 16th, 2012 · No Comments · Lab, Uncategorized

Classes Consider a database of student records for the university. What kind of data would be associated with each student? Download the Lab9 BlueJ project. It defines a new class Student which contains some student information Create students a number of students in BlueJ. Use the Inspector to examine their fields. Use the getName() method […]

[Read more →]

Tags:

Week 8 Tut – Objects

September 9th, 2012 · No Comments · Lab

Create an instance of the java.util.Random class in BlueJ using the Tools > Use Library Class… option. Right click on the object created to see its methods. Try running some of them. What do they do? Read the Java docs for the Random class. Which method would you use to: Simulate a fair coin toss? […]

[Read more →]

Tags:

Tutorial Wk 7 – ASCII Art

August 22nd, 2012 · No Comments · Lab

In this tutorial we will be working with 2D arrays to do some image manipulation. Download the BlueJ project ASCIIArt.zip. Inside you will find a class that contains the method readImage(String url). This method takes the URL for any image on the web and converts it into a 2D array of integers. Each entry in […]

[Read more →]

Tags:

More arrays

August 19th, 2012 · No Comments · Lab

This week’s tut covers two very common activities in programming: mapping and filtering. Write a method mapDouble which takes in an array of integers and returns a new array containing the double of each entry in the first array. Eg: int[] data = {1, 3, 4, 2, 0, 5, -2}; int[] doubled = mapDouble(data); The […]

[Read more →]

Tags:

Tutorial Wk 5

August 9th, 2012 · No Comments · Lab

If you did not finish all the exercises from last week’s lab, try to finish them off this week. If you have already completed those exercises, try these ones. Exercise 1. Write a method that accepts two arguments, an integer and an array of integers. Assume that the numbers in the array are sorted in […]

[Read more →]

Tags:

Tutorial – Wk4

August 2nd, 2012 · No Comments · Lab

This week, you will download the BlueJ project Week4.zip and write methods to manipulate arrays. Two methods are given to you complete. You don’t have to do anything to them. The method readArray public int[] readArray() reads a list of numbers, one per line, ending with a blank line, and returns an array containing the […]

[Read more →]

Tags:

Tutorial Wk 3 – Data types

July 27th, 2012 · No Comments · Lab

The exercises below use the Tut3.zip project for BlueJ. Data types What data type would you use to represent the following values? Why? The length of a piece of string. The number of students at UNSW. A person’s age. The mass of the sun. The exact number of stars in the Milky Way. The mathematical […]

[Read more →]

Tags: