COS 2213 units200 LevelSecond Semester

Computer Programming II

Foundation course — taken across University of Uyo programmes, not one department

COS 221 (Computer Programming II) is a 3-unit, 200 Level course taught in the Second Semester at the University of Uyo, Akwa Ibom State, Nigeria. It is a foundation course taken by undergraduates across the university's programmes, not one department's course.

Advanced programming building on COS 211: deeper object-oriented programming (polymorphism, abstract classes, interfaces), the Collections API, searching/sorting/recursion, event-driven and GUI programming. Bridges programming skills and the algorithmic thinking required for security tool development.

On Areté, COS 221 comes with

  • 12 lecture-note topics
  • 50 past-paper questions
  • 2 recommended textbooks
  • an AI tutor that has read this course’s outline and notes
Sign in to study COS 221

Free for University of Uyo students — sign in with your email, no password.

Course outline

  1. 01Advanced OOP review: polymorphism, abstract classes, and interfaces
  2. 02Class hierarchies and programme organization using packages/namespaces
  3. 03Collections API: iterators/enumerators, List, Stack, Queue
  4. 04Searching and sorting algorithms
  5. 05Recursive algorithms
  6. 06Event-driven programming: event-handling methods and event propagation
  7. 07Exception handling
  8. 08Graphical User Interface (GUI) programming

What the COS 221 lecture notes cover

  1. 01Fundamentals in Java Programming
  2. 02Flow Control Structures
  3. 03Array
  4. 04Methods (Functions)
  5. 05OOP I: Concept of Object-Oriented Programming
  6. 06OOP II: Inheritance, Interface, Polymorphism, and Abstract
  7. 07Exception Handling
  8. 08Threads
  9. 09Text File Handling
  10. 10Java Database Connectivity (JDBC)
  11. 11Graphical User Interfaces (GUI)
  12. 12Java String API

12 transcribed topics, taken from the lecturer’s own workbook. Readable in full once you sign in.

COS 221 key concepts

Secure
Java has advanced authentication and access-control features that help make web applications secure.
Portable
Java code runs on all major platforms unmodified — once a source file compiles into bytecode, that bytecode runs on any platform with a Java JDK, unlike languages that must be recompiled into machine code separately for each platform.
Robust
Java has strong memory management and exception-handling features that catch errors during execution and manage incorrect input.
Object-Oriented
A model of programming built around real-world entities — inheritance, data hiding, polymorphism. OOP's aim is to bind a portion of data and the functions that act on it together, so no other part of the code can access them directly.
Multithreaded
Java supports multithreaded programming, so a Java program can perform several tasks at the same time.
Architecture-Neutral
Compiling Java code produces bytecode that runs on many platforms with the help of the Java Runtime Environment (JRE) and Java Virtual Machine (JVM).
Interpreted
Java creates an intermediate representation called bytecode, which is what lets it run on any platform via the JDK.
High-Performance
Java uses a Just-In-Time (JIT) compiler, which converts bytecode instructions to enable faster execution.
Distributed
Java programs can access files on any machine on the internet using RMI and EJB, enabling distributed applications.
Dynamic
Java can compile and load a class dynamically, on demand — only the specifically required portion of code, rather than the whole program.
Variables in Java
A variable in Java is a human-readable name used to store data in computer memory — it lets a program store, read, and change data held in memory. A variable is also called an identifier, because it identifies values within a program.
Primitive
Uses a small, fixed amount of memory to represent a single item of data. Java has exactly eight: `byte`, `short`, `int`, `long`, `float`, `double`, `char`, and `boolean` — a Java program cannot define any others. Primitives are used so often that making them full objects would noticeably hurt performance.
Object (Non-Primitive)
A larger chunk of memory that can hold a great deal of data along with the methods used to process it. Every data member and local variable must be declared as either a primitive or an object (class) type.
char
A 16-bit character using the Unicode encoding scheme.
abs()
Returns the absolute value of a number — the number without its negative sign, so the result is always positive. Works on `int`, `long`, `float`, or `double` values.
sqrt()
Returns the square root of a positive number. Takes an `int` or `double` as input and always returns a `double`.
pow(x, y)
Computes x raised to the power y. Takes two `double` arguments (base, then power) and returns a `double` — integer or float arguments are implicitly converted to `double` first.
Conditional execution
The most common use of the "if-else" statement is to conditionally execute a block of code based on the result of a Boolean expression. For example, you might want to execute a block of code that performs a calculation only if a certain variable has a specific value.
Decision making
The "if-else" statement can also be used to make decisions in your code based on different conditions. For example, you might use an "if-else" statement to determine which of two different actions to take based on the value of a variable.
Error checking
The "if-else" statement can also be used to check for errors or invalid inputs in your code. For example, you might use an "if-else" statement to validate user input and display an error message if the input is not valid.
Multiple branches
The "if-else" statement can also be used to handle multiple branches of execution based on different conditions. For example, you might use multiple "if-else" statements to handle different cases in a switch statement.
Initialization expression
In the above example, int i = 1; is our initialization expression. In this expression we initialize the loop variable to some value so that the loop will start from the initialized value. In the above example the loop will start from 1 and continue to execute until it crosses the value 5.
Test expression
In the above example, i <= 5; is our test expression. The compiler will test the condition written in the test expression. If the condition evaluates to true, then the body of the loop will execute.
Step or increment
This part updates the expression. In the above example, i = i + 1 is our update expression. After executing the body of the loop, the update expression increments the loop variable i by 1 and then moves to test the condition written in the test expression.
Built-in Methods
These methods are predefined, and we can use them any time we want in our Java program. For example pow(), sqrt(), min(), etc.
User Defined Methods
These methods are defined or created by the programmer for performing a specific task in a program.
inputdetails()
for storing information in the instance variables.
calculate()
for calculating and storing the total and percentage obtained.

The 12 topics define many more terms than these — the full set, with flashcards, is in the notes.

Read the start of “Fundamentals in Java Programming”

Java is a simple, secure, portable, robust, object-oriented, multithreaded, architecture-neutral, interpreted, high-performance, distributed and dynamic programming language — also known as a "write-once, run-anywhere" language.

Simple —
Java is easy to learn.
Secure —
Java has advanced authentication and access-control features that help make web applications secure.
Portable —
Java code runs on all major platforms unmodified — once a source file compiles into bytecode, that bytecode runs on any platform with a Java JDK, unlike languages that must be recompiled into machine code separately for each platform.
Robust —
Java has strong memory management and exception-handling features that catch errors during execution and manage incorrect input.
Object-Oriented —
A model of programming built around real-world entities — inheritance, data hiding, polymorphism. OOP's aim is to bind a portion of data and the functions that act on it together, so no other part of the code can access them directly.
Multithreaded —
Java supports multithreaded programming, so a Java program can perform several tasks at the same time.
Architecture-Neutral —
Compiling Java code produces bytecode that runs on many platforms with the help of the Java Runtime Environment (JRE) and Java Virtual Machine (JVM).
Interpreted —
Java creates an intermediate representation called bytecode, which is what lets it run on any platform via the JDK.
High-Performance —
Java uses a Just-In-Time (JIT) compiler, which converts bytecode instructions to enable faster execution.
Distributed —
Java programs can access files on any machine on the internet using RMI and EJB, enabling distributed applications.
Dynamic —
Java can compile and load a class dynamically, on demand — only the specifically required portion of code, rather than the whole program.

That is the opening of topic 1 of 12. Sign in — free, no password — to read the rest, take the practice questions, and ask the AI tutor about any of it.

Read all 12 COS 221 topics

Recommended textbooks

  • Data Structures and Algorithms in Java — Robert Lafore

    2nd ed. — beginner-friendly bridge from COS 211

  • Introduction to Algorithms (CLRS) — Cormen, Leiserson, Rivest, Stein

    4th ed. — the definitive algorithms reference

How to pass COS 221

  • VisuAlgo (visualgo.net) provides free visual animations for every data structure — use it constantly
  • Implement every data structure from scratch at least once — never just read about it
  • Trace sorting algorithms step by step on a 5-element array by hand before every exam
  • Areté Java modules cover the programming foundation; use them for the Java component of this course

COS 221 — questions and answers

What is COS 221 at the University of Uyo?
COS 221 (Computer Programming II) is a 3-unit, 200 Level course taught in the Second Semester at the University of Uyo, Akwa Ibom State, Nigeria. It is a foundation course taken by undergraduates across the university's programmes, not one department's course. Advanced programming building on COS 211: deeper object-oriented programming (polymorphism, abstract classes, interfaces), the Collections API, searching/sorting/recursion, event-driven and GUI programming. Bridges programming skills and the algorithmic thinking required for security tool development.
Which programmes take COS 221?
COS 221 is a foundation course taken by undergraduates across University of Uyo programmes — it belongs to the university, not to one department. Whatever your department, Areté covers it with the same outline, textbooks and study tips.
What topics are covered in COS 221?
The COS 221 outline covers 8 topics: Advanced OOP review: polymorphism, abstract classes, and interfaces; Class hierarchies and programme organization using packages/namespaces; Collections API: iterators/enumerators, List, Stack, Queue; Searching and sorting algorithms; Recursive algorithms; Event-driven programming: event-handling methods and event propagation; Exception handling; Graphical User Interface (GUI) programming.
What textbooks are recommended for COS 221?
Recommended reading for COS 221: Data Structures and Algorithms in Java by Robert Lafore; Introduction to Algorithms (CLRS) by Cormen, Leiserson, Rivest, Stein.
How do I pass COS 221?
VisuAlgo (visualgo.net) provides free visual animations for every data structure — use it constantly Implement every data structure from scratch at least once — never just read about it Trace sorting algorithms step by step on a 5-element array by hand before every exam Areté Java modules cover the programming foundation; use them for the Java component of this course
Where can I find COS 221 lecture notes and past questions?
Areté (https://www.aretecyb.tech/courses/cos-221) carries 12 lecture-note topics, 50 past-paper questions, 2 recommended textbooks for COS 221, plus an AI tutor that has read the outline. It is free for University of Uyo students — sign in with your email, no password.

Other 200 Level courses

Lecture notes, practice questions and the AI tutor for COS 221 are available once you sign in.

Sign in to Areté