International Study Centre
(Foundation Computing)
Module Handbook
Introduction to Programming
Semester 1: Semester 3 2016
Tutor: Patrick Hodgkins
1.Module introduction
How do computers make decisions?
How do computers perform millions of complex information-processing tasks in a fraction of a second?
Part of the answer to these two questions is that programmers have written instructions that are translated or ‘compiled’ into a series of binary codes that the CPU of the computer can act upon. These instructions can be written in a variety of ‘languages’. Computer programmers write these instructions in languages ranging from low level Assembly Language where each instruction corresponds to just one operation of the CPU to different high level languages where each instruction causes the CPU to carry out many operations.
Programming is at the core of all undergraduate computing courses and the aim of this module is to provide relevant programming knowledge and skills for students progressing to the School of Informatics at the University of Sussex. At Sussex the high level language that is studied by all students in years 1 and 2 is called Java. Java is one of the most important high level languages because it is used extensively in general applications and is embedded in many ‘intelligent’ devices. It’s also the language that Android apps are written in.
The objectives of this module are:
- to introduce students to object oriented programming, helping them understand the concepts of program design, implementation and testing using Java.
- to continue the formative development of students by broadening their knowledge base, deepening their understanding of topics studied, and practising appropriate study skills, including computer based practical skills and problem solving.
- to continue the development of independent study skills in research, self-study and group work.
2.Learning Outcomes
At the end of this module, the successful student will be able to:
- Understand the principles of Object Orientated Programming and the steps involved in designing an algorithm to solve a problem.
- Write and test class implementations, applying good practice in program construction.
- Understand, design and implement class interactions and groupings to solve a problem.
- Understand and deploy a range of Java Library Classes.
- Develop and link a simple GUI using the Model, View and Control paradigm.
- Tutors and contact details
Patrick
- Teaching and assessment
Teaching modes
All teaching takes the form of seminar/workshops and a laptop computer is an essential piece of equipment. Some teaching will be on line through Study Direct.
Contributory assessment
Week / Assessment task / Weighting3 / From a detailed specification, design a Java class with conditional control structures and parameterized methods. / 20%
6 / From a detailed specification, design two classes associated by parameters and using conditional and iterative control structures. Complete a test class. / 25%
10 / Solve a problem with a less detailed specification involving aggregation and composition by developing a small number of classes.
Design a test class using Junit / 35%
14 / A one hour assessment of knowledge and understanding. / 20%
- Your tutors will expect that you:
- Attend all seminars
- Bring a laptop with Java SDK and BlueJ installed to seminars
- Acquire the Core Text book and prepare adequately for all seminars by completing recommended reading.
- Visit Study Direct each day to see updates and receive messages.
- Make an active contribution to seminars and discuss each session’s topics
- Discuss all questions with your tutor during seminars/workshops
- Be prepared to undertake group work and make timely contributions
- Submit all assessed assignments on or before deadlines
- Feedback
Coursework assignments will, as outlined above, consist of Java classes written to solve a set problem. These assignments will be read and tested by the tutor. Errors in coding or during run time will be indicated by the tutor on a hard copy of the student’s work.
The tutor will also comment on the student’s work and give recommendations for improvement.
An exemplar solution to the set problem will be posted on Study Direct.
7.Module overview
Week / Topic / Detail / Assessment Tasks / Weekly Learning Outcome1
w/b 2/5 / Introduction / Basic programming concepts. Objects and Classes. Fields and Methods. / Understand the terms: IDE, object, class, instance, method, signature, parameter, type, state, source code,return value, compiler
Use the BlueJ IDE to run and test a simple Java application with a number of classes.
Amend or add a simple method to a class
2
w/b
9/5 / Data representation and security
Control flow / Primitive and class Data types. Access modifiers and Encapsulation. The String class and its methods.
Local variables. Return types. / Understand the terms: field, instance variable, constructor, method, method header, method body,actual parameter, formal parameter, accessor, mutator, declaration, initialization.
Write a class that uses conditionals and parameters to solve a simple problem
3
w/b
16/5 / String data types
Printing Objects / Selection.
String equality
The ‘toString’ method
The String class in the Java library / Task 1 / Understand the terms: assignment statement, conditional statement, returnstatement, return type, comment, expression, operator, variable, local variable, scope, lifetime.
Can use the ‘equals’ method for Strings
Understands and can write a ‘toString’ method
4
w/b
23/5 / Introduction to testing / Testing using a debugger. Developing test classes. Using JUnit for testing. / Understand the terms: debug, syntax error, run time error,positive testing, negative testing, regression testing.
Use the BlueJ debugger and write a simple test class using JUnit.
5
w/b
30/5 / Objects interacting / Using parameters. Association. Association by Composition. Object parameters.
Overloading / Task 2 / Understand the terms: abstraction, modularization, divide and conquer, class diagram, object diagram,object reference, overloading, internal method call, external method call.
Solve a problem requiring the creation of two classes and add a test class.
6
w/b
6/6 / Object equality / Reference and defined equality. / Students understand the terms: reference equality, casting, object equality, stack, heap.
Students can distinguish between reference equality and object defined equality. Students understand how the JVM stores and references classes, objects and methods. Students can write a method to define object equality
7
w/b
13/6 / Using Java Library classes. / Class documentation. The Class Interface. Using an external API Writing class documentation. Usingjavadoc / Students understand the terms:
class interface, API, import, library.javadoc, @param, @return
Students can import a class to use in their applications. Students can write appropriate class documentation.
8
w/b
20/6 / Java collections
Grouping Objects / The ArrayList class. Iteration. Manipulating Fixed Arrays. The Java API. / Task 3 / Students understand the terms: collection, array, iterator, for-each loop, while loop, for loop, index, import, statement, library, package, anonymous object, definite iteration, indefinite, iteration
9
w/b
27/6 / Inheritance / Brief introduction to Inheritance. And its use in an OOP language / Students understand the terms: Inheritance, superclass (parent), subclass (child), is-a, inheritance hierarchy, super, sub type.
Students can add a subclass to an exiting hierarchy. Students can use polymorphic variables to simplify parametric association.
10
w/b
4/7 / Graphical User Interfaces. / Simple GUI’s. Buttons and text fields. Listeners. Accessing GUI components.
The MVC paradigm / Students understand the terms GUI, AWT, Swing, component, layout, event, event handling, event listener.
Students can create a simple GUI interface with input and output components. Students understand the term MVC.
11/12 / Project work
13 / Revision
- Module detail
Week / Topics / Resources and self study
Week1 / This week you will get know the BlueJ IDE by using it to run and test a drawing application called Shapes. You will learn how to instantiate and inspect objects from different classes and call the methods of these objects. We will then look at the source code of the class and identify the fields and methods.
By changing some of the code you will begin to understand the methods affect the behaviour of the objects and how different object communicate with each other.
You will then use an application called Lab Classes and to consolidate what you have learnt. / Instructional Video VN 1.1
Bluej-ref-manual.pdf
(SyD download)
Core Text:
Chapter 1
Wksht Shapes Tasks
Self study:
Exercises 1.16 to 1.18
Download ‘LAB-CLASSES’ from SyD
Exercise 1.27 to 1.29
Week 2 / This weekyou will learn:
- How objects are instantiated by the Class ‘Constructor’
- How different ‘Parameter’ values can change the kind of object that is constructed.
- You will also learn about Data Typesand Class/Object diagrams.
- You will start to edit the code of a method and add new fields and methods to an existing class.
- How methods need information to act on
- What ‘public’ and ‘private’ means.
- Why some methods only give out information and others can change their object’s properties
- Using the System class for printing to the screen
- How an application can make decisions
Presentation Ch 2
Download ‘TicketMachine’ from SyD
2.1, 2.2, 2.3, 2.4, 2.6, 2.15, 2.16
Self study:
Exercises 2.1 to 2.22
Ticket Machine tasks (worksheets)
Week 3 / This week you will learn about:
- Why two words with the same spelling may not be equal
Week 4 / This week you will learn:
- How to use the debugger to test your code
- How to write a test class
- About different kinds of testing
- How to use JUnit
Guide to BlueJ pages 20 to 23
Week 5 / This week you will learn:
- That data is not just numbers or words; it can be things!
- The difference between global and local variables.
- How objectscommunicate and interact.
- How one object can create another object.
- How the same class can produce different ‘shapes’ of object
- How objects can talk to themselves!
Presentation Ch 3
2.13, 2.14, 3.1 to 3.12
Download ‘CLOCK’ from SyD
5.32, 5.33
3.13
Download ‘Mail System’ from SyD
Self study:
Exercises 3.1 to 3.46
Week 6 / This week you learn:
- About the Java Virtual Machine (JVM)
- How Java stores classes, methods and variables in your computer’s memory.
- The different meanings of object ‘equality’
Week7 / This week you will learn that you can access and use thousands of ready-made Java classes for free! In fact a good Java programmer uses more of these classes than ones they have made themselves.
You can see these classes here: / Instructional Video VN 1.4
Presentation Ch 4
Exercises 4.1 to 4.59
Week 8 / This week you will learn:
- How to use collections of Java objects
- How applications do repetitive tasks by looping and looping ...
- How to search a collection
- How to develop an mp3 player
Download ‘Music Organizer’ from SyD
Week 9 / This week you learn:
- How classes can breed
- How child objects can inherit from their ‘parents’
Presentation Ch 8
Chapter 8
Week 10 / This week you will learn how to make a GUI for your application so that a user can interact using a mouse. / Chapter 11
Week 11-13 / Work on final project and revision for final assessment
9.Guidance on assessment
Assessment 1
From a detailed specification, design a Java class with conditional control structures and parameterized methods
Assessing Learning Outcomes 1 & 2
Assessment 2
From a detailed specification, design two classes associated by parameters and using conditional and iterative control structures. Complete a test class.
Assessing Learning Outcomes 1, 2 & 3
Assessment 3
Solve a problem with a less detailed specification involving aggregation and composition by developing a small number of classes.
Design a test class using Junit
Assessing Learning Outcomes 1, 2, 3, 4 & 5
The final assessment (20%) will consist of a series of multiple choice and short answer questions which will address the students’ knowledge and understanding of Object Oriented Programming and Java.
Assessing Learning Outcomes 1, 2, 3, 4 & 5
Core text:
Barnes & KollingObjects First with JavaPearson
Further reading:
Fisher & KollingThe BlueJ Environment Reference Manual University South Denmark
KollingTesting with JUnitUniversity South Denmark
Instructional video by David J. Barnes and Michael Kölling - a practical introduction using BlueJ", Pearson Education 2012.
1