|
1. OVERVIEW |
Description: COMP101 is the first year, semester one, "programming and problem solving by computer" module. The aim is to provide a comprehensive introduction to the software engineering of computer programs which produce solutions to problems. The development process (very broadly) divides into a number of stages: requirements, specification, implementation and system testing. Students will learn:
Problem analysis will concentrate on a top down approach. A number of specification techniques will be considered, but focusing on Object Oriented Design (OOD) techniques with the use of Nassi-Shneiderman charts for procedural aspects. Implementations will be in the Java Object Oriented high level computer programming language; thus the module will also provide a thorough overview of Object Oriented Programming. Program quality testing and analysis techniques considered include: limit testing, boundary value analysis, arithmetic testing, path testing and loop testing. Throughout the module students will have the opportunity to design their own programs and to solve a variety of problems. A sophisticated set of web pages have been produced to support the module (http://www.csc.liv.ac.uk/ ~frans/COMP101/comp101.html).
Teaching Method: Three lectures are given each week for the 12-week duration of the module. In addition, for one hour each week, students will work in a tutorial/practical setting under staff guidance. To this end students will be allocated to a tutorial groups. |
Each group comprises some 10 students and is supervised by a "COMP101" tutor. The first "port of call" for any student who has a COMP101 related problem should be their COMP101 tutor. (Note: your COMP101 tutor should not be confused with your "personal" tutor who will deal with any personal/pastoral problems that you might have.) Assessment: Assignments are carried out individually. Each assignment comprises a "stand-alone" problem which is to be addressed, using the object oriented software engineering approach taught on the module, to produce a computer generated solution. A grade will be returned for each assignment. The module is 100 % continuously assessed. All students will be required to obtain a satisfactory standard in the practical work so as to pass both the module and the year. To "pass" the year students must:
Should you be unfortunate enough to fail COMP101 (and you really have to try to fail a continuously assessed module) you will be invited to sit a resit examination during the summer recess. Resit examinatioin usually take place over a three week spanning the end of August and the begining of September (see University WWW pages for exact dates). It is necessary to pass the resit exam if you wish to continue at the University. The resit examination takes the form of a 3 hour practical. The examination is held in the confines of the University; it cannot be taken at some other location more convenient to your home! |
2. LECTURES |
The module comprises 36 lectures as follows:
3. PRACTICALS AND COURSE WORK |
4. THE JAVA 2 PLATFORM STANDARD EDITION 5.0 (J2SE 5.0) |
We will be using the suite of programs known as the Java 2 Standard Edition (J2SE 5.0) which is available free-of-charge (but subject to a licensing agreement) from Sun (the developers of Java) through their WWW pages at http://java.sun.com. The J2SE Software comprises the essential software required for writing and running Java programs. There is also a directory on documentation for all Java libraries (know as Application Programming Interfaces --- API) and a directory called the "Java tutorial". The J2SE, the API documentation and the tutorial occupy about 10 Mbyte each on disk (i.e 30 Mbyte all together).
5. JAVA WEB SITES |
Java is a WWW language thus, not surprisingly, there are many Java web sites that can be accessed and which provide all sorts of useful Java information. Some notable sites include:
![]() | http://www.javasoft.com, Sun's Java site, the source for the J2SE and the primary reference ("standard") for Java. |
![]() | http://www.gamelan.com, a good site for Java sources, information and interesting applets. |
![]() | http://liverpooljug.symbiandiaries.com, The Liverpool JUG (Java Users Group). |
![]() | http://www.javaworld.com, a monthly on-line magazine devoted to Java. |
![]() | http://www.mhhe.com/eng cs/compsci/kamin The home page for Samual kamin, Dennis Mickunas and Edward Reingold's book "An Introduction to Computer Science Using Java" (McGraw-Hill, 1998). |
![]() | http://www.csc.liv.ac.uk/~frans/COMP101/comp101.html, the Liverpool University Java web site (i.e. this and related pages). |
![]() | http://www.javaspecialists.co.za/ Heinz Kabutz' higly technical Java Newsletter (not for beginners!). |
![]() | http://www.cs.princeton.edu/~appel/modern/java/CUP/ CUP Parser Generator for Java (same functionality with respect to Java as YACC has to C) --- again not for beginners. |
6. LIST OF EXAMPLE PROBLEMS (QUICK REFERENCE) |
Here follows a list all the complete problems and solutions (using the COMP101 software development methodology) given as examples in the COMP101 notes:
Week | Title | Description |
---|---|---|
3 | Giant Java | Strings, classes and output methods. |
4 | Circle | Doubles and use Math class constants. |
4 | Pythagoras | Use of Math class methods (pow and sqrt). |
4 | 2D Geographic Distance | Type conversion (casts), passing instances as arguments, reusing user defined classes. |
5 | Lower to Upper Case Conversion | The character type. |
5 | Vertical Motion | Operators. |
5 | Cylinder calculation | Inheritance and class hierarchies. |
6 | Power 4 | Selection, simple if statement. |
6 | Linear Equation | Selection, if-else statement. |
6 | Calculator | Use of switch statement, and writing Boolean functions. |
6 | Temperature Conversion | more examples of the use of switch statements. |
7 | ASCII Code Output | "For" loops. |
7 | Arithmetic Progression | More "for" loops, inheritance and class hierarchies |
7 | Factorial | "For" loop with loop parameter decrementation. |
7 | Extended Factorial Application | Even more "for" loops. |
7 | Euler's Number Approximation | "While" loop. |
8 | Fibonacci sequence | "Do-while" loop example. |
8 | Multiplication table | Nested "for" loops and alternative implementation without nesting. |
9 | Random number generator | "While" loops and "do-while" loops. |
9 | Decimal to binary conversion | Recursion. |
9 | Metres to Yards, Feet and Inches conversion | Simple constrained array. |
10 | Set I/O | Array input and output. |
10 | Set intersection | Working with unconstrained arrays. |
11 | Password verification | String handling (character arrays). |
Additional example problems not included in the main body of the WWW material referenced above, but which have significant relevance to the material contained in the main body.
Week | Title | Description |
---|---|---|
4 | Sine, Cosine and Tangent | Trigonometric ratios. |
7. LIST OF EXAMPLE CODE FRAGMENTS |
Here follows a list of example code fragments (as opposed to complete example problems and their solution) that can be found in the COMP101 notes.
Week | Title | Description |
---|---|---|
2 | Hello World 1 | First ever Java program, simple output. |
3 | Data initialisation Class | Examples of declaring and initialising data items. |
3 | Data initialisation Application Class | Example application class with data initialisation. |
3 | Hello World 2 | Simple input and output. |
3 | Integer input 1 | Numeric input (and output). |
4 | Example class version 1 | Illustration of method calls with return value. |
4 | Example class version 2 | Illustration of method calls with argument passing and return value. |
4 | Test harness 1 | "Test harness" program 1 (Pythagoras). |
4 | Test harness 2 | "Test harness" program 2 (2-D geog. distance). |
4 | Rounding | Distinction between casting and rounding. |
5 | Character input | Using read to input single characters. |
5 | Operator evaluation | Evaluation of operators, precedence rules. |
5 | Super/Sub class | Inheritance and class hierarchies. |
6 | switch example 1 | Use of the switch (case) statement. |
6 | Menu interface 1 | Use of switch statement to create a menu style interface. |
7 | "Smiley" faces 1 | For loop example. |
7 | Sequence of numbers | Use of loop parameter in for loops (output). |
7 | sequence of even numbers | Use of loop parameter in for loops (calculation). |
7 | Backward sequence of numbers | Use of for loop with loop parameter decrementation. |
7 | Euler's numbers 2 | Solution to Euler's Number problem implemented using a for loop. |
7 | "Smiley" faces 2 | "Smiley" faces example implemented using a "while" loop. |
7 | Menu interface 2 | Second version of Menu interface (with switch and while statements). |
7 | For loop examples | Omitting parameters in for loop construct. |
8 | Integer input loop 1 | Variable count "do-while" loop example. |
8 | Integer input loop 2 | Same as "Integer input loop 1", but implemented using a variable count "while" loop. |
8 | Integer input loop 3 | Same as "Integer input loop 1", but implemented using a variable count "for" loop. |
8 | Integer input loop 4 | Continuous "do-while" loop with break statement. |
8 | "Smiley" faces 3 | "Smiley" faces example implemented using a "do-while" loop. |
8 | Random number generator 2 | Alternative solution to Random number generator example problem using the Random API class method. |
9 | Decimal to hexadecimal conversion | Use of recursion. |
9 | Fibonacci | Alternative (recursive) implementation of Fibonacci problem. |
10 | Array length example | use of length variable. |
10 | Cube mapping | Example of an array mapping operation. |
10 | Odd number filter | Example of an array filter operation. |
10 | Average | Example of an array folding operation. |
10 | Zip | Example of an array zipping operation. |
10 | Set I/O | Declaration of unconstrained arrays. |
10 | Variable count loop | Loop testing illustration. |
11 | Dec2Hex 2 | Declaration of arrays of instances. |
11 | String example 1 | Declaration of instances of the class String. |
11 | String example 2 | "Short cut" declaration of instances of the class String. |
11 | String operations | Use of methods in the String class. |
11 | Call by value example | Example of "call by value" parameter passing. |
11 | Call by reference value example | Example of "call by reference value" parameter passing. |
11 | Hello World 3 | Command line arguments. |
11 | Add up 1 | Numeric (integer) command line arguments. |
11 | Scope rule example | Scope rule illustration. |
Additional example code fragments not included in the main body of the COMP101 notes, but which have some relevance to the material contained there in.
Title | Description |
---|---|
Hello World 4 | More sophisticated input and output. |
Char 2 String | Character to string conversion. |
switch example 2 | Use of the switch (case) statement (date validation). |
9. ADDITIONAL MATERIAL |
Links to further Java notes which do not form part of the COMP101 syllabus but which may prove useful in the context of later modules in the 2nd and 3rd years of study. Note that these were developed using Java 1.4 (Java 4) so will not display any Java 5 features.
General:
GUIs AND THE AWT AND SWING PACKAGES:
Note: The following WWW page were commenced in January 2000 before Java Swing. However, I have converted many of the examples so that they now use the javax.swing classes as indicated below. I recommend using Swing where ever possible (you simply "swing" the components into place!).
|
|
APPLETS:
JAVA SPACES:
Created and maintained by Frans Coenen. Last updated 10 February 2015