CA166: Computer Programming II

2011-12



Contents



Course Material

Everything in the notes below is examinable unless a note on this page indicates otherwise.
This applies even if the material was not covered in lectures. Note also that some sections of the notes are tagged "Optional" or "Advanced" but these tags do not apply to CA166.

Printing: The font sizes are adequate for printing two pages per sheet

1. Basic Java

Lectures Review of basic java
Lectures Good programming practice
Program code: Console class Place the text in the same directory as your program and compile. Then use freely.
Exercises: Exercise Sheet 1.

2. Static Methods and Strings

Lectures  Static methods: procedures
Lectures  Static methods: functions
Lectures  Programming with static methods
Lectures  Characters and strings
Exercises: Exercise Sheet 2.


3. Introduction to Classes

Lectures Classes & objects  
Lectures Classes: constructors  
Exercises: Exercise Sheet 3.


4. Classes: Instance Methods

Lectures Classes: instance methods
Lectures Classes: class parameters
Lectures Classes: access control
Exercises: Part A Exercise Sheet 4A.
Exercises: Part B Exercise Sheet 4B     Sample input file persons.txt

5. Arrays: Sorting and Searching

Lectures Arrays
Lectures Array searching
Lectures Array sorting
Exercises: Exercise Sheet 5

Assessed Exercise: Assessed Exercise 1    Deadline: see Weekly Schedule

6. Programming with Classes

Lectures Nested objects
Lectures More on classes
Exercises: Exercise Sheet 6.

7. Classes: large example

Lectures Large example with classes  This is an important self-study exercise
Exercises: Exercise Sheet 7.  Solutions are in Solutions 7. Do not look at these until you have attempted the problems yourself.

8. Exceptions

Lectures Exceptions  Exceptions will only be examined to the extent that they are need for file handling.

9. Text files

Lectures Text Files Text files
Code ConsoleReader.java
Exercises: Exercise Sheet 9     A sample file courses.txt

10. Binary Files

Lectures Binary Files 
Exercises: Exercise Sheet 10    ints.dat      league.dat      DisplayPoints.class   
Assessed Exercise 2: Assessed Exercise 2  Sample test files: books.dat   transactions.txt    Deadline: see Weekly Schedule

11. Object and Wrapper Classes

Lectures Object & wrapper classes

12. Collections: Lists 

Lectures Lists Sections 6 is not examinable.
Exercises: Exercise Sheet 12  Sample files taxpayers.txt   unemployed.txt  

13. Recursion

Lectures Recursion
Exercises: Exercise Sheet 13

14. Quicksort

Lectures Quicksort     .

15. Complexity Analysis

Lectures Running times of methods  Sections 9 & 10 and calculating the running time of methods with nested loops is not examinable.
Exercises: Exercise Sheet 15  Solutions are in Solutions to Exercise Sheet 15. Do not look at these until you have attempted the problems yourself.



Java on Windows

There is a quick guide to getting started with Java in the School of Computing under Windows XP. and for installing and using Java on a home computer. For  more on the basics of using Windows XP take a look at this Windows shell tutorial.


Attendance Requirements

You are expected to attend all lectures.
 

You are obliged to attend your allocated tutorials and supervised labs.


An attendance record will be kept. You must attend at the time and place allocated to you. You may not attend sessions allocated to groups other than your own, except in exceptional circumstances and with permission. If you miss tutorials or labs more than occasionally, the course team will not be sympathetic if you subsequently get into difficulties. If an illness leads to a prolonged absence, provide a medical certificate and due allowance will be made. If you find yourself not attending, you are very likely on a path that will lead to failure. Seek advice immediately, in the first instance from your course tutor, or if that is not satisfactory from the module coordinator.


Preparing for Tutorials

Tutorials  and labs provide you with practice in applying the material of the course, and a supportive environment in which you can get help with particular diffciulties. Each tutorial will cover one or two topics, usually drawn from the preceding week's lectures. You are expected to have familiarised yourself with the subject matter of the tutorials in advance; you are not expected to have mastered the material, but you should at least know your way around the associated lecture notes. The tutorial problems are published in advance so that you know what to expect.
 

You must bring the associated exercise sheet and the relevant lecture notes to the tutorial.


You are expected to spend additional study time on your own to master the material of the course.


Regulations for assessed exercises

Projects are individual

All assessed exercises are individual projects, to be carried out on your own. They are not carried out in partnership with anyone else, whether they are on the course or not. Help is available from tutorial staff.

Ethics

Assessed exercises are part of the examination process and must be treated accordingly. It is a serious offence to copy or collude in assessed exercises. The course employs copying detection software for all assessed exercises. Read the University’s policy on copying and collusion, and the School’s supplement to this Academic Ethics and Assessed Exercises. For a detailed guide specifically pertaining to programming exercises in CA166 read Frequently Asked Questions on doing assessed exercises.

Submission

Assessed exercises are not directly submitted, but rather are automatically collected as specific files from specific directories. You are given the details in each case. You receive an e-mail  shortly after the submission date  informing you that your solution has been collected. The e-mail goes to your DCU  e-mail account. If you don't appear to have got an e-mail even though you submitted an exercise, you should first make sure it has not ended up in your Spam directory. Check also your School of Computing account (this is different from your DCU account -- it has a form that looks like jsmyth2@computing.dcu.ie).

Submission by e-mail or in person

It is not possible to submit your program except through the automatic system -- programs go through automatic checks (such as looking for compile time errors) that cannot be easily be done otherwise. If you make a submission by e-mail it will not be marked.

Retaining submitted work

You must not remove your program or (or otherwise do anything that might impede collection) at least until you have received the confirmation e-mail. You are strongly advised to preserve your directory and files (with date stamps) to resolve any dispute that might later arise.

Presentation

Assessed exercises must be professionally presented, with appropriate variable names, well indented to reveal structure, easily i9dentified separation between classes, lines that fit on standard A4 paper, etc.

Late submissions

Every assessed exercise has a hand-in date. There is no facility for late submissions except in serious personal circumstances, most typically a case of prolonged serious illness. An illness of a couple of days immediately prior to the deadline is not normally treated as a prolonged serious illness. If an assessed exercise is to be submitted late, you must normally get clearance in advance by e-mailing the module lecturer. You will be asked to submit evidence of the special circumstances (typically a medical cert).
 

Examinations

The module is assessed by continuous assessment (weighted at 20%) and a written exam at the end of the course (weighted at 80%). A clear pass is obtained by achieving at least 40% overall. The autumn repeats use the same continuous assessment marks as the apply for the summer exams; there is no opportunity to repeat continuous assessment for the autumn exams..

Students who repeat the module in the following year must also repeat  the continuous assessment.


A sample exam paper from a previous year is provided.  Solutions to previous exam papers are not available.


A Java Reference will be provided in written exams. You should study this is advance and be comfortable with reading it.




Contacting Staff

The course lecturer is available for questions after every lecture, and most queries should be raised then. You should normally raise issues with your tutor during tutorial sessions; 


If a matter is so urgent that it cannot wait till the next lecture or tutorial, you may contact the relevant staff member via e-mail. Bear in mind, however, that academic staff  receive large amounts of e-mail, so please do not e-mail them without thought. Staff do not offer help with programs through e-mail; instead, ask for help at labs, tutorials, lectures, or clinics.
.

Continuous Assessment

Continuous assessment accounts for 20% of the final mark for the module. This consists of credit for work done in labs, and two assessed exercises. The second assessed exercise carries more weight than the first one. A typical breakdown is lab: 6%, Assessed Exercise 1: 6%, Assessed Exercise 2: 8%. The assessed exercises may carry additional weight when some lab sessions cannot be scheduled. 

Continuous Assessment Marks

Continuous assessment are available  here at the end of the course.