There are three tasks for this week’s lab: Activate your CSE account. Write your first program! Play with BlueJ Activate your CSE account The first thing we will do in this week’s lab is activate your CSE account, if you haven’t done so already. Login as ‘newuser’ Follow the prompts to activate your account. Write […]
Tags:
The marks for labs have been finalised and uploaded. Check your results here: https://cgi.cse.unsw.edu.au/~give/Student/sturec.php You should see the following fields: labXX – Lab mark, out of 2 for each lab from weeks 2 to 12 labTotal – mark out of 10, the final lab result, worth 10% of the course mark. To get full marks for […]
Tags:
This lab is the final opportunity to mark outstanding work. This lab is also an opportunity to ask any revision questions or questions about the exam.
Tags:
Download the Uno Game BlueJ project shown in the lecture. Constructors Use the debugger to watch how cards are constructed: Set a breakpoint in the WildDrawCard constructor (line 17). Create a new WildDrawCard by calling the constructor.. Use the ‘step into’ button to step through the code. Observe how the super() call works. Repeat this process for […]
Tags:
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 time […]
Tags:
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 the […]
Tags:
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 to access […]
Tags:
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? […]
Tags:
In this tutorial you 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 the 2D […]
Tags:
Finish the exercises from last week than attempt the Using Arrays exercises in the example problems below. Here are some hints about how to do exercise 2 from last week. Suppose we have an array of some fixed length, say 10. Java initialises all the elements to zero. Now let’s assume that we only want […]
Tags: