SlideShare a Scribd company logo
Teaching Method and
Flexible Tools
MATERIALS FOR STUDENTS
THE PRESENTATION OF THE PSEUDOCODE LANGUAGE
This project has been funded with support from the European Commission.
This publication reflects the views only of the author, and the Commission
cannot be held responsible for any use which may be made of the
information contained therein.
Algorithms’ representation using a pseudocode language 1
The pseudocode language is a means to represent algorithms for problem solving. It is a
symbolic language generated by the natural language where there are rules characteristic to
programming languages.
The basic elements of the pseudocode are the key-words. They have a strict meaning and
are used in syntactical formulas which aim to describe the algorithms’ fundamental structures.
Thus, we can speak about a vocabulary of the pseudocode language. The key-words can be
classified as follows:
Key-words which define the types of data with which the algorithms operate : integer,
real, boolean, string
Key-words which are used to writhe instructions read, write, if, then, else, while, do,
repeat, until, for, end, stop
Consequently, any algorithm starts and finishes with the words Algorithm name,
respectively Stop.
PRE-PRIMARY SCHOOL
THEORETICAL APPROACH
READ-WRITE INSTRUCTIONS
They describe the operations of data reading and writing.
For data input we use the key-word Read.
Syntax:
Read list
Effect: Key- word read followed by the list of variables whose values will be read,
separated by a comma.
Example:
Read a, b
Respectively, for writing the results we use the key-word Write.
Syntax:
Write list
Effect: the key-word write followed by the list of variables whose values will be
displayed, separated by a comma.
Example:
Write the average
1
Livovschi, Leon, Georgescu, Horia – Sinteza şi analiza algoritmilor, Editura Ştiinţifică, Bucureşti, 1986
Observation: For better understanding, we will also write a message, in inverted
commas “ ” , separated by space by the exit data.
PRACTICE
Exercise 1
Read a number, then print the read number.
Read_write algorithm
Integer a
Read a
Write “read number ”, a
Stop
Exercise 2
What number must □ have for the equality to be true:
5 + □ =13
Indication: we will use the reverse operation to addition that is the substraction, to
find the unknown value, actually we will solve a number one degree equation, with an
unknown value.
The assigning algorithm
Integer x
x← 13 - 5
Write “x= ”, x
Stop
FIRST CLASS
THEORETICAL APPROACH
THE ASSIGNING INSTRUCTION
It describes the assigning operation in any algorithm
Syntax: v:=e or v ← e
Effect: The v variable will be assigned the value of the expression e.
This occurs over 2 stages:
1) It is calculated the value for the expression e
2) The v variable is assigned the value obtained in 1)
PRACTICE
Exercise 1
Read 2 integers a, b. Fiind aut which is the largest and display the value.
Algorithm
Integer a, b
Read a, b
if a>b then write it is larger ’,a
else write ’it is larger ’,b
end_if
Stop
Exercise 2
Read 2 integers a, b. Calculate their sum and display it.
The algorithm of the sum
Integer a, b
Read a, b
s←a+b;
write ’the sum is’,s
Stop
SECOND CLASS
THEORETICAL APPROACH:
An algorithm is a collection of symbols used in mathematics and logics, which, by a
succesion of operations solves an entire class of similar problems. The known data
of the problem which is to be coded in a programming language are called input
data. The results obtained after the problem solving are called exit data.
INPUT DATA ―‣ ALGORITHM ―‣ EXIT DATA
Many problems have other data, which are not known from the start thus they are
not considered input data. At the same time, these data are not as important as to be
written. However, they are useful in different stages of problem solving and algorithm
coding, they are absolutely necessary. That is why they are called intermediate or auxiliary
data.
PRACTICE
Exercise 1
Justin has two glasses: one with rasberry juice and one with coke, same capacity,
both full. Write, using an algorithm, the succesion of stages used by Justin to change
the content of the two glasses, without mixing them.
Indication:
We will code the glass with rasberry juice as variable a and the glass with coke as
variable b. To change the beverages we will use a third glass, empty glass, coded as
auxiliary.
The succesion of the steps is the following: the problem is similar with the following one.
o We pour in auxiliary empty glass the content of glass a
o We pour in glass a the content of glass b
o We pour in glass b the content of glass a
integer a, b, aux;
read a, b;
aux←a;
a←b;
b←aux;
write a, b
Stop
Exercise 2
In class 2nd A at the Theoretical Highschool Tudor Arghezi from Craiova, the
number of girls equals the double of boys. How many boys and how many girls if
the total is 24 pupils?
Indication:
We notice that if we code the number of girls as f and the number of boys as b we get
f=2*b. So, the class is formed by 1b+2b=3b. The operation of dividing the total number of pupils
by three will give the number of boys,that is 8. We double this value and we get the number of
girls , that is 16.
This algorithm can be used for any type of data, by assigning the corresponding values of
the problem to be solved.
integer b, f, t;
t←24;
b←t/3;
f←b*2;
write ’the number of boys is ’,b, ’ and the number of girls is ’,f
Stop
THIRD CLASS
THEORETICAL APPROACH
Expressions are a string which contains:
• A variable
• A variable operator a variable
• An expression operator an expression
• operator expression (for the operators such as – (5+3) )
Operators can be:
• the symbol ” – ” for substraction
• the symbol ” + ” for addition
• the symbol ” * ” for multiplication
• the symbol ” / ” for division
• the symbol ” % ” to get the rest of the division of the first value to the second one.
Example:
a % b = the rest of the division of a to b
a % 2 = the rest of the division of a to 2, which is 1 if a is an odd number or 0 if a is an even
number
a % 10 = the rest of the division of a to 10 , which is the last digit of a, the unit digit.
Observations:
1. the order of operations is similar to mathematics: first the multiplication and the division then
addition and substraction .
2. We can use brackets for more complex expressions, but only round ones.
PRACTICE
Exercise 1
At a maths competition the students are supposed to solve 40 problems. Each
correct answer gets 2 points, each wrong answer gets minus 0,5 points. Bonus points 20.
Alex solved 20 problems correctly but he was wrong about 12. How many points did he
score?
Indication:
We coded as rightnumber the number of correct answers and wrongnumber the number
or false answers. We calculated the scores separately, for right answers with the rightnumber
variable respectively the false answers with the wrongnumber variable. To get the final results,
we will add 20 bonus points to the rightnumber variable then we will substract the wrongnumber
variable.
This algorithm can be used for any values, provided they are assigned in the programme,
as the respective problem requests.
The algorithm of the competition
Integer a,b, sc, sp, sg
rightnumber←28
wrongnumber ←12
rightnumber ←28*2
wrongnumber ←12*0.5
totalnumber← rightnumber +20- wrongnumber
Write “Alex got =“, totalnumber
Stop
Exercise 2
Adrian and Cristian have 65 €, Cristian and Bob have 52 €, while Adrian and Bob
have 47 €. What sum does each of them have?
Indication:
We coded a Adrian’s sum, b Bob’s sum and c Cristian’s sum. We wrote the mathematical
relations given in the problem.
Step 1. a+c=65 (1)
Step 2. c+b=52 (2)
Step 3. a+b=47 (3)
Step 4. From (2) we substract (3) and we get:
c-a=5 (4), which in correlation with (1) gives c=35
Step 5. By substitution, from (2), we get b=17
Step 6. From (1) we get a=30
Step 7. Write a, b,c
FOURTH CLASS
THEORETICAL APPROACH
The data the algorithms operate with are called variables. A variable is
characterised by:
• name – it is reffered to as a combination of letters and numbers and it is compulsory
that the first one is a letter: a, Beta, no1, no2
• type: integer, real, string, logic
• value: depending on the type of data, a variable can be assignes one of the above
values;
It is called a variable because its assigned value may vary.
If we want to compare, we can picture a box destined to one purpose only: integer values
in “boxes” for integers, real values in “boxes” for real values and so on.
At the beginning of each algorithm we must state clearly the type of each variable we use.
To solve problems using algorithms, it is necessary to know the type of data assigned to the
variables. Thus, in coding, similar to mathematics, there are key-words for various data
types:
 Simple types
• Integer
• Real
• Boolean(logic)
• Structured data type
• Table
• Set
• String
• File
PRACTICE
Exercise 1
Using the pseudocode language, write the algorithm which reads 2 integer variables
and writes their arithmetical mean.
Indication: The two variables will be assigned integer values while their arithmetical
mean will be a real number, that is will be of real type.
Arithmetical mean algorithm
Integer a, b
Real am
Read a, b
am←(a+b)/2
Write “the arithmetical mean of “, a “ and“ , b, “ is=“, am
Stop
Exercise 2
The Ionescus bought a rectangular piece of land with sides of 30m and 20m. The
house they intend to build there is also of a rectangle shape, with sides of 10m and 6m,
while the pool will be a square with the side of 5m. The rest will be lawn. What is the
surface of the lawn?
Indication:
We will code the piece of land dimensions as a and b, the house dimensions as c and d,
and the pool as e. As there are specific values assigned to these dimensions, the variables will be
attributed these respective values. For any other dimensions, these values can be altered, by
assigning them differently. In turn, we will calculate the total surface, the house surface and the
lawn surface. Finally, we will substract from the total surface the sum between the house and
pool surface to get the remaining surface of the lawn.
The algorithm
Integer a,b, hs, ps, ls
a←30
b←20
c←10
d←6
e←5
ts←a•b
s←c•d
hs←e•e
ls←ts-(hs+ls)
Write “the lawn surface =“, ls
Stop

More Related Content

What's hot

Segments and Properties of Real Numbers (Geometry 2_2)
Segments and Properties of Real Numbers (Geometry 2_2)Segments and Properties of Real Numbers (Geometry 2_2)
Segments and Properties of Real Numbers (Geometry 2_2)
rfant
 
Basic Algebra Ppt 1.1
Basic Algebra Ppt 1.1Basic Algebra Ppt 1.1
Basic Algebra Ppt 1.1
Cincinnati State
 
Inequalities lesson 4
Inequalities lesson 4Inequalities lesson 4
Inequalities lesson 4
KathManarang
 
Number System
Number SystemNumber System
Number System
samarthagrawal
 
REAL NUMBERS
REAL NUMBERSREAL NUMBERS
REAL NUMBERS
Sariga Vinod
 
Maths project
Maths projectMaths project
Maths project
Ruchi Dixit
 
1.1/1.2 Properties of Real Numbers
1.1/1.2 Properties of Real Numbers1.1/1.2 Properties of Real Numbers
1.1/1.2 Properties of Real Numbers
leblance
 
IIT JEE Maths 1985
IIT JEE Maths   1985IIT JEE Maths   1985
IIT JEE Maths 1985
Vasista Vinuthan
 
TechMathII - 1.1 - The Set of Real Numbers
TechMathII - 1.1 - The Set of Real NumbersTechMathII - 1.1 - The Set of Real Numbers
TechMathII - 1.1 - The Set of Real Numbers
lmrhodes
 
Cei03 ppt 01
Cei03 ppt 01Cei03 ppt 01
Cei03 ppt 01
Latanya Saunders
 
1.1 Real Numbers and Number Operations
1.1 Real Numbers and Number Operations1.1 Real Numbers and Number Operations
1.1 Real Numbers and Number Operations
Sarah Stillwell
 
Number system
Number systemNumber system
Number system
Prajjwal Kushwaha
 
Algebra 1 Slide Show
Algebra 1 Slide ShowAlgebra 1 Slide Show
Algebra 1 Slide Show
jordysmith13
 
Algebraic expressions and Polynomials
Algebraic expressions and PolynomialsAlgebraic expressions and Polynomials
Algebraic expressions and Polynomials
Mary Ann Guerrero
 
NS1: Rational and Irrational numbers
NS1: Rational and Irrational numbersNS1: Rational and Irrational numbers
NS1: Rational and Irrational numbers
A Wright
 
Rational numbers
Rational numbersRational numbers
Rational numbers
Poonam Singh
 
Number system
Number systemNumber system
Number system
jahnvi tanwar
 
Number System
Number SystemNumber System
Number System
9562
 
Number systems
Number systemsNumber systems
Number systems
Ankit Goel
 
CBSE Class 10 Mathematics Real Numbers Topic
CBSE Class 10 Mathematics Real Numbers TopicCBSE Class 10 Mathematics Real Numbers Topic
CBSE Class 10 Mathematics Real Numbers Topic
Edvie
 

What's hot (20)

Segments and Properties of Real Numbers (Geometry 2_2)
Segments and Properties of Real Numbers (Geometry 2_2)Segments and Properties of Real Numbers (Geometry 2_2)
Segments and Properties of Real Numbers (Geometry 2_2)
 
Basic Algebra Ppt 1.1
Basic Algebra Ppt 1.1Basic Algebra Ppt 1.1
Basic Algebra Ppt 1.1
 
Inequalities lesson 4
Inequalities lesson 4Inequalities lesson 4
Inequalities lesson 4
 
Number System
Number SystemNumber System
Number System
 
REAL NUMBERS
REAL NUMBERSREAL NUMBERS
REAL NUMBERS
 
Maths project
Maths projectMaths project
Maths project
 
1.1/1.2 Properties of Real Numbers
1.1/1.2 Properties of Real Numbers1.1/1.2 Properties of Real Numbers
1.1/1.2 Properties of Real Numbers
 
IIT JEE Maths 1985
IIT JEE Maths   1985IIT JEE Maths   1985
IIT JEE Maths 1985
 
TechMathII - 1.1 - The Set of Real Numbers
TechMathII - 1.1 - The Set of Real NumbersTechMathII - 1.1 - The Set of Real Numbers
TechMathII - 1.1 - The Set of Real Numbers
 
Cei03 ppt 01
Cei03 ppt 01Cei03 ppt 01
Cei03 ppt 01
 
1.1 Real Numbers and Number Operations
1.1 Real Numbers and Number Operations1.1 Real Numbers and Number Operations
1.1 Real Numbers and Number Operations
 
Number system
Number systemNumber system
Number system
 
Algebra 1 Slide Show
Algebra 1 Slide ShowAlgebra 1 Slide Show
Algebra 1 Slide Show
 
Algebraic expressions and Polynomials
Algebraic expressions and PolynomialsAlgebraic expressions and Polynomials
Algebraic expressions and Polynomials
 
NS1: Rational and Irrational numbers
NS1: Rational and Irrational numbersNS1: Rational and Irrational numbers
NS1: Rational and Irrational numbers
 
Rational numbers
Rational numbersRational numbers
Rational numbers
 
Number system
Number systemNumber system
Number system
 
Number System
Number SystemNumber System
Number System
 
Number systems
Number systemsNumber systems
Number systems
 
CBSE Class 10 Mathematics Real Numbers Topic
CBSE Class 10 Mathematics Real Numbers TopicCBSE Class 10 Mathematics Real Numbers Topic
CBSE Class 10 Mathematics Real Numbers Topic
 

Similar to Exercises for pupils in primary education(0 4)-en

Plane-and-Solid-Geometry. introduction to proving
Plane-and-Solid-Geometry. introduction to provingPlane-and-Solid-Geometry. introduction to proving
Plane-and-Solid-Geometry. introduction to proving
ReyRoluna1
 
Module 1 solving inequalities notes
Module 1 solving inequalities notesModule 1 solving inequalities notes
Module 1 solving inequalities notes
Michelle Barnhill
 
1.1a
1.1a1.1a
Math 116 pres. 3
Math 116 pres. 3Math 116 pres. 3
1 1 number theory
1 1 number theory1 1 number theory
1 1 number theory
smillertx281
 
Linear algebra application in linear programming
Linear algebra application in linear programming Linear algebra application in linear programming
Linear algebra application in linear programming
Lahiru Dilshan
 
Oop with c++ notes unit 01 introduction
Oop with c++ notes   unit 01 introductionOop with c++ notes   unit 01 introduction
Oop with c++ notes unit 01 introduction
Ananda Kumar HN
 
Chapter 5 algebra
Chapter 5 algebraChapter 5 algebra
Chapter 5 algebra
jennytuazon01630
 
Math8_Q2_Mod2_Illustratinglinearinequalitiesintwovariables_v2.pdf
Math8_Q2_Mod2_Illustratinglinearinequalitiesintwovariables_v2.pdfMath8_Q2_Mod2_Illustratinglinearinequalitiesintwovariables_v2.pdf
Math8_Q2_Mod2_Illustratinglinearinequalitiesintwovariables_v2.pdf
EllaFlorPalconaga
 
Ecuaciones y Desigualdades.pdf
Ecuaciones y Desigualdades.pdfEcuaciones y Desigualdades.pdf
Ecuaciones y Desigualdades.pdf
edwinllantoy2
 
C++ for beginners
C++ for beginnersC++ for beginners
C++ for beginners
Salahaddin University-Erbil
 
MATH7 ADM MODULE 3.pdf
MATH7 ADM MODULE 3.pdfMATH7 ADM MODULE 3.pdf
MATH7 ADM MODULE 3.pdf
NelsonNelson56
 
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
Slides With MANAV
 
Linear equations in disguise
Linear equations in disguiseLinear equations in disguise
Linear equations in disguise
julienorman80065
 
Course project solutions 2019
Course project solutions 2019Course project solutions 2019
Course project solutions 2019
Robert Geofroy
 
Rafsay castillo
Rafsay castilloRafsay castillo
Rafsay castillo
RafsayCastillo
 
Digital Systems Design Using Verilog 1st edition by Roth John Lee solution ma...
Digital Systems Design Using Verilog 1st edition by Roth John Lee solution ma...Digital Systems Design Using Verilog 1st edition by Roth John Lee solution ma...
Digital Systems Design Using Verilog 1st edition by Roth John Lee solution ma...
endokayle
 
Module 1 topic 1 notes
Module 1 topic 1 notesModule 1 topic 1 notes
Module 1 topic 1 notes
Michelle Barnhill
 
Solving One Step Inequalities
Solving One Step InequalitiesSolving One Step Inequalities
Solving One Step Inequalities
Jessca Lundin
 
Maths notes for 4038 and 4016 paper
Maths notes for 4038 and 4016 paperMaths notes for 4038 and 4016 paper
Maths notes for 4038 and 4016 paper
Fabian Hkb
 

Similar to Exercises for pupils in primary education(0 4)-en (20)

Plane-and-Solid-Geometry. introduction to proving
Plane-and-Solid-Geometry. introduction to provingPlane-and-Solid-Geometry. introduction to proving
Plane-and-Solid-Geometry. introduction to proving
 
Module 1 solving inequalities notes
Module 1 solving inequalities notesModule 1 solving inequalities notes
Module 1 solving inequalities notes
 
1.1a
1.1a1.1a
1.1a
 
Math 116 pres. 3
Math 116 pres. 3Math 116 pres. 3
Math 116 pres. 3
 
1 1 number theory
1 1 number theory1 1 number theory
1 1 number theory
 
Linear algebra application in linear programming
Linear algebra application in linear programming Linear algebra application in linear programming
Linear algebra application in linear programming
 
Oop with c++ notes unit 01 introduction
Oop with c++ notes   unit 01 introductionOop with c++ notes   unit 01 introduction
Oop with c++ notes unit 01 introduction
 
Chapter 5 algebra
Chapter 5 algebraChapter 5 algebra
Chapter 5 algebra
 
Math8_Q2_Mod2_Illustratinglinearinequalitiesintwovariables_v2.pdf
Math8_Q2_Mod2_Illustratinglinearinequalitiesintwovariables_v2.pdfMath8_Q2_Mod2_Illustratinglinearinequalitiesintwovariables_v2.pdf
Math8_Q2_Mod2_Illustratinglinearinequalitiesintwovariables_v2.pdf
 
Ecuaciones y Desigualdades.pdf
Ecuaciones y Desigualdades.pdfEcuaciones y Desigualdades.pdf
Ecuaciones y Desigualdades.pdf
 
C++ for beginners
C++ for beginnersC++ for beginners
C++ for beginners
 
MATH7 ADM MODULE 3.pdf
MATH7 ADM MODULE 3.pdfMATH7 ADM MODULE 3.pdf
MATH7 ADM MODULE 3.pdf
 
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
 
Linear equations in disguise
Linear equations in disguiseLinear equations in disguise
Linear equations in disguise
 
Course project solutions 2019
Course project solutions 2019Course project solutions 2019
Course project solutions 2019
 
Rafsay castillo
Rafsay castilloRafsay castillo
Rafsay castillo
 
Digital Systems Design Using Verilog 1st edition by Roth John Lee solution ma...
Digital Systems Design Using Verilog 1st edition by Roth John Lee solution ma...Digital Systems Design Using Verilog 1st edition by Roth John Lee solution ma...
Digital Systems Design Using Verilog 1st edition by Roth John Lee solution ma...
 
Module 1 topic 1 notes
Module 1 topic 1 notesModule 1 topic 1 notes
Module 1 topic 1 notes
 
Solving One Step Inequalities
Solving One Step InequalitiesSolving One Step Inequalities
Solving One Step Inequalities
 
Maths notes for 4038 and 4016 paper
Maths notes for 4038 and 4016 paperMaths notes for 4038 and 4016 paper
Maths notes for 4038 and 4016 paper
 

More from Georgeta Manafu

Formular sel Tr Ankara
Formular sel  Tr AnkaraFormular sel  Tr Ankara
Formular sel Tr Ankara
Georgeta Manafu
 
Formular sel Mk
Formular sel MkFormular sel Mk
Formular sel Mk
Georgeta Manafu
 
Linkommunity C3
Linkommunity C3Linkommunity C3
Linkommunity C3
Georgeta Manafu
 
Gantt MY CODE SIBLING - MYCODESIB
Gantt MY CODE SIBLING - MYCODESIBGantt MY CODE SIBLING - MYCODESIB
Gantt MY CODE SIBLING - MYCODESIB
Georgeta Manafu
 
Ppt new werd - en
Ppt   new werd - enPpt   new werd - en
Ppt new werd - en
Georgeta Manafu
 
newWERD
newWERDnewWERD
Ppt newWERD
Ppt   newWERDPpt   newWERD
Ppt newWERD
Georgeta Manafu
 
Linkommunity poster
Linkommunity posterLinkommunity poster
Linkommunity poster
Georgeta Manafu
 
Activ martie mai 2019-en
Activ martie mai 2019-enActiv martie mai 2019-en
Activ martie mai 2019-en
Georgeta Manafu
 
Formular draft
Formular   draftFormular   draft
Formular draft
Georgeta Manafu
 
B9ae6301
B9ae6301B9ae6301
B9ae6301
Georgeta Manafu
 
Report on the monitoring of student safety and security in school
Report on the monitoring of student safety and security in schoolReport on the monitoring of student safety and security in school
Report on the monitoring of student safety and security in school
Georgeta Manafu
 
Formular C1
Formular   C1Formular   C1
Formular C1
Georgeta Manafu
 
Turbine eoliene ilie tradus
Turbine eoliene ilie tradusTurbine eoliene ilie tradus
Turbine eoliene ilie tradus
Georgeta Manafu
 
Razele x tradus
Razele x tradusRazele x tradus
Razele x tradus
Georgeta Manafu
 
Radiatii nucleare-padureanu tradus
Radiatii nucleare-padureanu  tradusRadiatii nucleare-padureanu  tradus
Radiatii nucleare-padureanu tradus
Georgeta Manafu
 
Panouri solare tradus
Panouri solare tradusPanouri solare tradus
Panouri solare tradus
Georgeta Manafu
 
Dozimetrul(1)
Dozimetrul(1)Dozimetrul(1)
Dozimetrul(1)
Georgeta Manafu
 
Dozimetrul en
Dozimetrul enDozimetrul en
Dozimetrul en
Georgeta Manafu
 

More from Georgeta Manafu (20)

Formular sel Tr Ankara
Formular sel  Tr AnkaraFormular sel  Tr Ankara
Formular sel Tr Ankara
 
Formular sel Mk
Formular sel MkFormular sel Mk
Formular sel Mk
 
Linkommunity C3
Linkommunity C3Linkommunity C3
Linkommunity C3
 
Gantt MY CODE SIBLING - MYCODESIB
Gantt MY CODE SIBLING - MYCODESIBGantt MY CODE SIBLING - MYCODESIB
Gantt MY CODE SIBLING - MYCODESIB
 
Ppt new werd - en
Ppt   new werd - enPpt   new werd - en
Ppt new werd - en
 
newWERD
newWERDnewWERD
newWERD
 
Ppt newWERD
Ppt   newWERDPpt   newWERD
Ppt newWERD
 
Linkommunity poster
Linkommunity posterLinkommunity poster
Linkommunity poster
 
Activ martie mai 2019-en
Activ martie mai 2019-enActiv martie mai 2019-en
Activ martie mai 2019-en
 
Formular draft
Formular   draftFormular   draft
Formular draft
 
Bb11ee109(1)
Bb11ee109(1)Bb11ee109(1)
Bb11ee109(1)
 
B9ae6301
B9ae6301B9ae6301
B9ae6301
 
Report on the monitoring of student safety and security in school
Report on the monitoring of student safety and security in schoolReport on the monitoring of student safety and security in school
Report on the monitoring of student safety and security in school
 
Formular C1
Formular   C1Formular   C1
Formular C1
 
Turbine eoliene ilie tradus
Turbine eoliene ilie tradusTurbine eoliene ilie tradus
Turbine eoliene ilie tradus
 
Razele x tradus
Razele x tradusRazele x tradus
Razele x tradus
 
Radiatii nucleare-padureanu tradus
Radiatii nucleare-padureanu  tradusRadiatii nucleare-padureanu  tradus
Radiatii nucleare-padureanu tradus
 
Panouri solare tradus
Panouri solare tradusPanouri solare tradus
Panouri solare tradus
 
Dozimetrul(1)
Dozimetrul(1)Dozimetrul(1)
Dozimetrul(1)
 
Dozimetrul en
Dozimetrul enDozimetrul en
Dozimetrul en
 

Recently uploaded

South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 

Exercises for pupils in primary education(0 4)-en

  • 1. Teaching Method and Flexible Tools MATERIALS FOR STUDENTS THE PRESENTATION OF THE PSEUDOCODE LANGUAGE This project has been funded with support from the European Commission. This publication reflects the views only of the author, and the Commission cannot be held responsible for any use which may be made of the information contained therein.
  • 2. Algorithms’ representation using a pseudocode language 1 The pseudocode language is a means to represent algorithms for problem solving. It is a symbolic language generated by the natural language where there are rules characteristic to programming languages. The basic elements of the pseudocode are the key-words. They have a strict meaning and are used in syntactical formulas which aim to describe the algorithms’ fundamental structures. Thus, we can speak about a vocabulary of the pseudocode language. The key-words can be classified as follows: Key-words which define the types of data with which the algorithms operate : integer, real, boolean, string Key-words which are used to writhe instructions read, write, if, then, else, while, do, repeat, until, for, end, stop Consequently, any algorithm starts and finishes with the words Algorithm name, respectively Stop. PRE-PRIMARY SCHOOL THEORETICAL APPROACH READ-WRITE INSTRUCTIONS They describe the operations of data reading and writing. For data input we use the key-word Read. Syntax: Read list Effect: Key- word read followed by the list of variables whose values will be read, separated by a comma. Example: Read a, b Respectively, for writing the results we use the key-word Write. Syntax: Write list Effect: the key-word write followed by the list of variables whose values will be displayed, separated by a comma. Example: Write the average 1 Livovschi, Leon, Georgescu, Horia – Sinteza şi analiza algoritmilor, Editura Ştiinţifică, Bucureşti, 1986
  • 3. Observation: For better understanding, we will also write a message, in inverted commas “ ” , separated by space by the exit data. PRACTICE Exercise 1 Read a number, then print the read number. Read_write algorithm Integer a Read a Write “read number ”, a Stop Exercise 2 What number must □ have for the equality to be true: 5 + □ =13 Indication: we will use the reverse operation to addition that is the substraction, to find the unknown value, actually we will solve a number one degree equation, with an unknown value. The assigning algorithm Integer x x← 13 - 5 Write “x= ”, x Stop FIRST CLASS THEORETICAL APPROACH THE ASSIGNING INSTRUCTION It describes the assigning operation in any algorithm Syntax: v:=e or v ← e Effect: The v variable will be assigned the value of the expression e. This occurs over 2 stages: 1) It is calculated the value for the expression e 2) The v variable is assigned the value obtained in 1) PRACTICE Exercise 1 Read 2 integers a, b. Fiind aut which is the largest and display the value. Algorithm Integer a, b Read a, b if a>b then write it is larger ’,a else write ’it is larger ’,b
  • 4. end_if Stop Exercise 2 Read 2 integers a, b. Calculate their sum and display it. The algorithm of the sum Integer a, b Read a, b s←a+b; write ’the sum is’,s Stop SECOND CLASS THEORETICAL APPROACH: An algorithm is a collection of symbols used in mathematics and logics, which, by a succesion of operations solves an entire class of similar problems. The known data of the problem which is to be coded in a programming language are called input data. The results obtained after the problem solving are called exit data. INPUT DATA ―‣ ALGORITHM ―‣ EXIT DATA Many problems have other data, which are not known from the start thus they are not considered input data. At the same time, these data are not as important as to be written. However, they are useful in different stages of problem solving and algorithm coding, they are absolutely necessary. That is why they are called intermediate or auxiliary data. PRACTICE Exercise 1 Justin has two glasses: one with rasberry juice and one with coke, same capacity, both full. Write, using an algorithm, the succesion of stages used by Justin to change the content of the two glasses, without mixing them. Indication: We will code the glass with rasberry juice as variable a and the glass with coke as variable b. To change the beverages we will use a third glass, empty glass, coded as auxiliary. The succesion of the steps is the following: the problem is similar with the following one. o We pour in auxiliary empty glass the content of glass a o We pour in glass a the content of glass b o We pour in glass b the content of glass a
  • 5. integer a, b, aux; read a, b; aux←a; a←b; b←aux; write a, b Stop Exercise 2 In class 2nd A at the Theoretical Highschool Tudor Arghezi from Craiova, the number of girls equals the double of boys. How many boys and how many girls if the total is 24 pupils? Indication: We notice that if we code the number of girls as f and the number of boys as b we get f=2*b. So, the class is formed by 1b+2b=3b. The operation of dividing the total number of pupils by three will give the number of boys,that is 8. We double this value and we get the number of girls , that is 16. This algorithm can be used for any type of data, by assigning the corresponding values of the problem to be solved. integer b, f, t; t←24; b←t/3; f←b*2; write ’the number of boys is ’,b, ’ and the number of girls is ’,f Stop THIRD CLASS THEORETICAL APPROACH Expressions are a string which contains: • A variable • A variable operator a variable • An expression operator an expression • operator expression (for the operators such as – (5+3) ) Operators can be: • the symbol ” – ” for substraction • the symbol ” + ” for addition • the symbol ” * ” for multiplication • the symbol ” / ” for division
  • 6. • the symbol ” % ” to get the rest of the division of the first value to the second one. Example: a % b = the rest of the division of a to b a % 2 = the rest of the division of a to 2, which is 1 if a is an odd number or 0 if a is an even number a % 10 = the rest of the division of a to 10 , which is the last digit of a, the unit digit. Observations: 1. the order of operations is similar to mathematics: first the multiplication and the division then addition and substraction . 2. We can use brackets for more complex expressions, but only round ones. PRACTICE Exercise 1 At a maths competition the students are supposed to solve 40 problems. Each correct answer gets 2 points, each wrong answer gets minus 0,5 points. Bonus points 20. Alex solved 20 problems correctly but he was wrong about 12. How many points did he score? Indication: We coded as rightnumber the number of correct answers and wrongnumber the number or false answers. We calculated the scores separately, for right answers with the rightnumber variable respectively the false answers with the wrongnumber variable. To get the final results, we will add 20 bonus points to the rightnumber variable then we will substract the wrongnumber variable. This algorithm can be used for any values, provided they are assigned in the programme, as the respective problem requests. The algorithm of the competition Integer a,b, sc, sp, sg rightnumber←28 wrongnumber ←12 rightnumber ←28*2 wrongnumber ←12*0.5 totalnumber← rightnumber +20- wrongnumber Write “Alex got =“, totalnumber Stop Exercise 2 Adrian and Cristian have 65 €, Cristian and Bob have 52 €, while Adrian and Bob have 47 €. What sum does each of them have? Indication: We coded a Adrian’s sum, b Bob’s sum and c Cristian’s sum. We wrote the mathematical relations given in the problem. Step 1. a+c=65 (1) Step 2. c+b=52 (2)
  • 7. Step 3. a+b=47 (3) Step 4. From (2) we substract (3) and we get: c-a=5 (4), which in correlation with (1) gives c=35 Step 5. By substitution, from (2), we get b=17 Step 6. From (1) we get a=30 Step 7. Write a, b,c FOURTH CLASS THEORETICAL APPROACH The data the algorithms operate with are called variables. A variable is characterised by: • name – it is reffered to as a combination of letters and numbers and it is compulsory that the first one is a letter: a, Beta, no1, no2 • type: integer, real, string, logic • value: depending on the type of data, a variable can be assignes one of the above values; It is called a variable because its assigned value may vary. If we want to compare, we can picture a box destined to one purpose only: integer values in “boxes” for integers, real values in “boxes” for real values and so on. At the beginning of each algorithm we must state clearly the type of each variable we use. To solve problems using algorithms, it is necessary to know the type of data assigned to the variables. Thus, in coding, similar to mathematics, there are key-words for various data types:  Simple types • Integer • Real • Boolean(logic) • Structured data type • Table • Set • String • File PRACTICE Exercise 1 Using the pseudocode language, write the algorithm which reads 2 integer variables and writes their arithmetical mean. Indication: The two variables will be assigned integer values while their arithmetical mean will be a real number, that is will be of real type.
  • 8. Arithmetical mean algorithm Integer a, b Real am Read a, b am←(a+b)/2 Write “the arithmetical mean of “, a “ and“ , b, “ is=“, am Stop Exercise 2 The Ionescus bought a rectangular piece of land with sides of 30m and 20m. The house they intend to build there is also of a rectangle shape, with sides of 10m and 6m, while the pool will be a square with the side of 5m. The rest will be lawn. What is the surface of the lawn? Indication: We will code the piece of land dimensions as a and b, the house dimensions as c and d, and the pool as e. As there are specific values assigned to these dimensions, the variables will be attributed these respective values. For any other dimensions, these values can be altered, by assigning them differently. In turn, we will calculate the total surface, the house surface and the lawn surface. Finally, we will substract from the total surface the sum between the house and pool surface to get the remaining surface of the lawn. The algorithm Integer a,b, hs, ps, ls a←30 b←20 c←10 d←6 e←5 ts←a•b s←c•d hs←e•e ls←ts-(hs+ls) Write “the lawn surface =“, ls Stop