Презентация Introduction to Programming онлайн
На нашем сайте вы можете скачать и просмотреть онлайн доклад-презентацию на тему Introduction to Programming абсолютно бесплатно. Урок-презентация на эту тему содержит всего 41 слайд. Все материалы созданы в программе PowerPoint и имеют формат ppt или же pptx. Материалы и темы для презентаций взяты из открытых источников и загружены их авторами, за качество и достоверность информации в них администрация сайта не отвечает, все права принадлежат их создателям. Если вы нашли то, что искали, отблагодарите авторов - поделитесь ссылкой в социальных сетях, а наш сайт добавьте в закладки.
Презентации » Устройства и комплектующие » Introduction to Programming
Оцените!
Оцените презентацию от 1 до 5 баллов!
- Тип файла:ppt / pptx (powerpoint)
- Всего слайдов:41 слайд
- Для класса:1,2,3,4,5,6,7,8,9,10,11
- Размер файла:201.55 kB
- Просмотров:92
- Скачиваний:0
- Автор:неизвестен
Слайды и текст к этой презентации:
№3 слайд
Содержание слайда: Static view
A program consists of a set of classes.
Features are declared in classes. They define operations on objects constructed from the class.
Queries answer questions. They have a result type.
Commands execute actions. They do not have a result type.
Terms “class” and “type” used interchangeably for now.
№5 слайд
Содержание слайда: Static view vs. dynamic view
Queries (attributes and functions) have a return type. However, when executing the query, you get an object.
Routines have formal arguments of certain types. During the execution you pass objects as actual arguments in a routine call.
During the execution local variables declared in a routine are objects. They all have certain types.
№9 слайд
Содержание слайда: Exercise: Find the classes / objects
feature
is_occupied (a_location: traffic_place): boolean
-- Check if `a_location' is occupied by some flat hunter.
require
a_location_exists: a_location /= Void
local
old_cursor: cursor
do
Result := False
-- Remember old cursor position.
old_cursor := players.cursor
...
№10 слайд
Содержание слайда: Exercise: Find the classes / objects
-- Loop over all players to check if one occupies
-- `a_location'.
from
players.start
-- do not consider estate agent, hence skip the first
-- entry in `players'.
players.forth
until
players.after or Result
loop
if players.item.location = a_location then
Result := True
end
players.forth
end
-- Restore old cursor position.
players.go_to(old_cursor)
end
№11 слайд
Содержание слайда: Who are Adam and Eve?
Who creates the first object? The runtime creates a so called root object.
The root object creates other objects, which in turn create other objects, etc.
You define the type of the root object in the project settings.
You select a creation procedure of the root object as the first feature to be executed.
№13 слайд
Содержание слайда: You are an acrobat
When you are asked to Clap, you will be given a number. Clap your hands that many times.
When you are asked to Twirl, you will be given a number. Turn completely around that many times.
When you are asked for Count, announce how many actions you have performed. This is the sum of the numbers you have been given to date.
№15 слайд
Содержание слайда: You are an acrobat with a buddy
You will get someone else as your Buddy.
When you are asked to Clap, you will be given a number. Clap your hands that many times. Pass the same instruction to your Buddy.
When you are asked to Twirl, you will be given a number. Turn completely around that many times. Pass the same instruction to your Buddy.
If you are asked for Count, ask your Buddy and answer with the number he tells you.
№18 слайд
Содержание слайда: You are an author
When you are asked to Clap, you will be given a number. Clap your hands that many times. Say “Thank You.” Then take a bow (as dramatically as you like).
When you are asked to Twirl, you will be given a number. Turn completely around that many times. Say “Thank You.” Then take a bow (as dramatically as you like).
When you are asked for Count, announce how many actions you have performed. This is the sum of the numbers you have been given to date.
№25 слайд
Содержание слайда: I am the root object
prepare_and_play
local
acrobat1, acrobat2, acrobat3 : ACROBAT
partner1, partner2: ACROBAT_WITH_BUDDY
author1: AUTHOR
curmudgeon1: CURMUDGEON
do
create acrobat1
create acrobat2
create acrobat3
create partner1.make (acrobat1)
create partner2.make (partner1)
create author1
create curmudgeon1
author1.clap (4)
partner1.twirl (2)
curmudgeon1.clap (7)
acrobat2.clap (curmudgeon1.count)
acrobat3.twirl (partner2.count)
partner1.buddy.clap (partner1.count)
partner2.clap (2)
end
№35 слайд
Содержание слайда: Implementing marry I
class PERSON
feature
spouse: PERSON
marry (a_other: PERSON)
require
a_other /= Void
a_other.spouse = Void
spouse = Void
do
a_other.spouse := Current
spouse := a_other
ensure
spouse = a_other
a_other.spouse = Current
end
invariant
spouse /= Void implies spouse.spouse = Current
end
№36 слайд
Содержание слайда: Implementing marry II
class PERSON
feature
spouse: PERSON
marry (a_other: PERSON)
require
a_other /= Void
a_other.spouse = Void
spouse = Void
do
a_other.set_spouse (Current)
spouse := a_other
ensure
spouse = a_other
a_other.spouse = Current
end
set_spouse (a_person: PERSON)
do
spouse := a_person
end
invariant
spouse /= Void implies spouse.spouse = Current
end
№37 слайд
Содержание слайда: Implementing marry III
class PERSON
feature
spouse: PERSON
marry (a_other: PERSON)
require
a_other /= Void
a_other.spouse = Void
spouse = Void
do
a_other.set_spouse (Current)
spouse := a_other
ensure
spouse = a_other
a_other.spouse = Current
end
feature {PERSON}
set_spouse (a_person: PERSON)
do
spouse := a_person
end
invariant
spouse /= Void implies spouse.spouse = Current
end
№38 слайд
Содержание слайда: Implementing marry : final version
class PERSON
feature
spouse: PERSON
marry (a_other: PERSON)
require
a_other /= Void
a_other.spouse = Void
spouse = Void
do
spouse := a_other
a_other.set_spouse (Current)
ensure
spouse = a_other
a_other.spouse = Current
end
feature {PERSON}
set_spouse (a_person: PERSON)
do
spouse := a_person
end
invariant
spouse /= Void implies spouse.spouse = Current
end
№41 слайд
Содержание слайда: What we have seen
Invariant should only depend on Current object
If invariant depends on other objects
Take care who can change state
Take care in which order you change state
Invariant can be temporarily violated
You can still call features on Current object
Take care calling other objects, they might call back
Although writing invariants is not that easy, they are necessary to do formal proofs. This is also the case for loop invariants (which will come later).
Скачать все slide презентации Introduction to Programming одним архивом:
-
Programming Introduction
-
Mathematical functions, characters, and strings. Introduction to Java Programming
-
Introduction and paradigms. Programming language concepts. (Lecture 1)
-
Principles of programming. Languages introduction. Objectives
-
Programming languages
-
EVerge Programming Workshop
-
Система программирования PascalABC. NET и электронный задачник Programming Taskbook
-
C Programming
-
Первая программа в среде NXT 2. 1 Programming
-
SB/LS Achieve (Master) Introduction