Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Lecture 1.docx
Скачиваний:
1
Добавлен:
01.07.2025
Размер:
704 Кб
Скачать
☆

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

  1. Prepare a list of 10 executable programs existing on disks of your computer. Study various ways of starting them up.

  2. 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.

  3. Work out the algorithm for converting temperature expressed in Celsius to Fahrenheit. Depict it as a flow chart and write down in pseudocode.

  4. 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.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]