- •Lecture 1 Programs and algorithms
- •1.1. How a computer operates?
- •1.2. Algorithms and programming languages
- •If (condition) then ... Or if (condition) then ... Else ...
- •1.3. Summary
- •1.4. Exercises
- •Lecture 2 Fundamentals of programming I
- •2.1. The language
- •2.2. Quick start: first program and basics of syntax
- •2.3. Data in a program (variables and literals)
- •2.4. Operations on data (operators and expressions)
- •2.5. Summary
- •2.6. Exercises
- •Lecture 3 Fundamentals of programming II
- •3.1. Making decisions
- •3.2. Iterations
- •3.3. Arrays
- •3.4. Functions
- •3.5. Summary
- •3.6. Exercises
- •Lecture 4 Java and object-oriented methodology
- •4.1. What is Java
- •4.1.1 Java as a universal programming language
- •4.1.2. Java as a cross-platform language
- •4.1.3. Java as a universal environment for gui programming
- •4.1.4. Java as a universal environment for accessing data bases
- •4.1.5. Java as a universal multimedia programming environment
- •4.1.6. Java as a universal means for client-server programming
- •4.1.7. Java in a distributed environment
- •4.1.8. Java as an environment for building applications from ready-to-use components.
- •4.1.9. Java as the environment for xml processing
- •4.1.10. Micro Java
- •4.1.11. Why is Java worth learning?
- •4.2. Introduction to objects
- •4.4. The first program
- •5.2. Literals
- •5.3. Types of variables. Declarations.
- •Type_name variable_name;
- •Identifiers
- •Naming conventions:
- •5.4. More on operators and expressions
- •5.5. Numeric promotions
- •5.6. Summary
- •5.7. Exercises
- •Lecture 6 Objects
- •6.1. Objects and references
- •6.2. The class String
- •6.3. Useful examples
- •6.4. Summary
- •7.2. Defining attributes of objects
- •7.3. Defining operations on objects (methods)
- •7.4 Defining methods of object creation (constructors)
- •7.5. Example
- •7.6. Inheritance
- •7.7. Summary
- •7.8. Exercises
- •Lecture 8 Classes II
- •8.1. Accessing class members. The variable this.
- •8.2. Static members
- •AClassName.AFieldName
- •8.3. Explicit initialization
- •8.4. Packages and imports
- •8.5. Scope of an identifier. Local variables. Access control.
- •8.6. Structure of a program. Running an application.
- •8.7. Summary
- •8.8. Exercises
- •Lecture 9 Decisions
- •9.1. A brief survey of control statements.
- •9.2. Comparison operators and expressions
- •9.3. Logical operators and expressions
- •9.4. Making decisions: the if and if-else statements.
- •9.5. Multivariant selections done with the switch statement.
- •9.6. The conditional operator ?:
- •9.7. Summary
- •9.8. Exercises
1.3. Summary
The lecture answers the following questions:
What is a program?
What are programs designed for?
How are programs represented in a computer and how are they executed?
What are assemblers designed for and why they came into being?
How higher level languages differ from assemblers?
What does programming consist in?
What is an algorithm?
How are algorithms represented and written down?
How are flow charts made?
What is pseudocode and what is it designed for?
How are algorithms encoded in pseudocode?
What sorts of programming languages exist?
What is compilation of a program?
What is interpretation of a program?
What steps does the process of programming include (from formulation of the problem to ready-to-run software)?
The above points define too the scope of knowledge and ability acquainted reading the lecture.
1.4. Exercises
Prepare a list of 10 executable programs existing on disks of your computer. Study various ways of starting them up.
Find in the Internet as many programming languages as you can. How many can you find? Try to find out which of them are the most popular and what their uses are.
Work out the algorithm for converting temperature expressed in Celsius to Fahrenheit. Depict it as a flow chart and write down in pseudocode.
Work out an algorithm for converting currencies (number of currencies taken into consideration is arbitrary but grater than 1). It should allow converting given amount of money from one currency to another. Depict it as a flow chart and write down in pseudocode.
Lecture 2 Fundamentals of programming I
The lecture introduces basic programming terms and demonstrates them using very simple programs and simple programming language. Special attention is drawn to the meaning of features common to all programming languages. Thanks to the language chosen for presentation, which hides sophisticated technical details from a programmer, students are able to produce their own working programs soon.
2.1. The language
In
the previous lecture we learnt the notion of an algorithm and found
out, that solving a problem with a computer requires an algorithm.
Writing a program, we encode an abstract algorithm into some
programming language.
We are going to use the Java
language to learn programming. Lecture 4 introduces reader to this
enormous and fascinating environment. The lectures following that
discover its secrets step by step.
Before it takes place,
its worth looking at fundamental programming principles using much
simpler and more intuitive environment.
We start with the REXX
language, or rather its simplified (for the sake of this lecture)
version.
Note that for
now we don't deal with object
oriented programming concepts. These ideas appear gradually starting
with the next lecture, their full treatment being put off till next
semester.
Object oriented model of programming came into being
as a way to eliminate some drawbacks specific to structural
programming concept and based on it programming languages (for
example Algol, Fortran, PL/I, C or REXX).
Thus, the meaning and
the essence of object oriented programming are better understood by
those who have some knowledge of non-object languages. For this
reason it is worth reading this lecture. Besides, all language
elements presented here have their counterparts in Java language.
But if all of these elements are present in Java, why should
one start with another language?
There are four
characteristic features of the REXX language:
syntax similar to English language syntax
no need for declarations of variables and declaring their types
dynamic arrays
reach set of built-in functions with clear names and arguments
which allow using it as a kind of pseudocode for encoding of algorithms. This lecture is not about REXX (in fact only fundamental fragments of it are presented here, and some of them are modified for this lecture's needs); however it is worth discovering this language because of its simplicity and usability. Interesting links related to REXX, NetRexx and ObjectRexx.
