M1G413283
Introduction to Programming 2
Announcements:
Announcements for this module will be posted on Blackboard.
- Lectures
- Tutorials
- Labs
- Assessment
- Reading
- Staff
Click on a title to see the list of topics in that chapter.
Use the download links to get full notes or lecture slides in PDF or PPT
format.
Download
- notes | slides | code
Programming techniques in this chapter:
Arrays, static variables and methods, constants, do-while loop, main method
Class associations in this chapter:
"has-a" relationships - one-to-one and one-to-many
Contents
Interaction between game and players
The Player class in Java
Implementing the interaction
Arrays
Static, final and constants
Loops: do-while
The main method
The Game class in Java
Download
- notes | slides | code
Programming techniques in this chapter:
stepwise refinement, unit testing, documentation, enhanced for loop
Class associations in this chapter:
"has-a" relationships, "uses-a" relationships
Contents
Interaction between rooms and items
The Item class in Java
Implementing the interaction
Algorithms and stepwise refinement
Unit testing
Documentation
The Player class - using the Item and Room classes
Download
- notes | slides | code
Programming techniques in this chapter:
library classes, using API documentation
Class associations in this chapter:
self relationships
Contents
The Java platform
Using library classes
Using the ArrayList library class
Testing the new Room class
Linking rooms together
More changes to Room? Test Again!
Creating the game “world”
Download
- notes | slides | code
Programming techniques in this chapter:
Inheritance, polymorphism, casting, switch statement
Class associations in this chapter:
“is-a” relationships, “uses-a” relationships
Contents
Different kinds of items
Inheritance
Polymorphism
Casting
Introducing interactivity - handling commands
The Command class
The Parser class
Processing a Command
The switch statement
The modified game loop
Running the game
Some notes are in PDF format - you may need Adobe Reader to view and print them. You can download it using the link below:
Note that tutorial sheets will be available before the relevant tutorials, and solutions will be available when all groups have completed the tutorial.
Note that solutions are sample solutions, and there may be alternative valid answers in some cases.
Note that lab sheets can be accessed online during the lab sessions. Lab sheets will be available before the relevant labs if you want to print these out before coming to the lab.
Lab 1
Note that there is also an assignment on Blackboard associated with this lab activity.
Lab 2 | starter project
Note that there is also an assignment on Blackboard associated with this lab activity.
Lab 3 | starter project
Note that there is also an assignment on Blackboard associated with this lab activity.
Lab 4 | starter project | PatternFiles.zip | OrderForm.java | About.java
Note that there is also an assignment on Blackboard associated with this lab activity.
This module will be assessed as follows:
Continuous assessment: 40%
Lab work will be submitted on a weekly basis and credit will be given for each lab
Class test: 60%
There will be a multiple choice test on Blackboard, which will be taken during lab sessions in week 6
There is no set text for this module, but you may find the following books useful:
Objects First with Java: A Practical Introduction Using BlueJ
byDavid J. Barnes and Michael Kolling
(ISBN 0137005628)
Studying Programming
by Sally Fincher
(ISBN 1403946876)
Jim Paterson, Room M628, 0141 331 3028, James.Paterson-at-gcal.ac.uk
Katrin Hartmann, Room M611
When sending e-mail please substitute -at- with the usual internet e-mail name/address separator