Grade 9
/ Algorithms 15 exercises (including 0 corrected)
- Simple algorithm (2 exercices)
- Algorithm and repetition (6 exercices)
- Algorithm and conditional (1 exercice)
- Event programming (2 exercices)
s’orienter à90
quandest cliquée∑acer toutaller à x:-200y:-100s’orienter à90Mettrecôtéà100triangleavancer decôtéAjouter àcôté-20répéter5fois123457896
dé∏nir trianglestylo en position écritureavancer decôtétournerde120degrésrépéter3foisrelever le stylo123456
tournerde60degrés
Figure 1Figure 2Figure 3
quandest cliquécacheraller à x:0y:0s’orienter à90degrésmettrelongueurà90e∑acer toutmettre la taille du stylo à3stylo en position d’écritureun tourajouter àlongueur30répéter2foisDé∏nir un touravancer delongueurtournerde90degésrépéter2foisajouter àlongueur30avancer delongueurtournerde90degrésrépéter2fois
s’orienter à90degrés
E.7615
The
following
program
is
given
that
draws
several
equilateral
triangles
of
different
sizes.
This
program
has
a
variable
named
ˇ
side
ı.
The
lengths
are
given
in
pixels.
Recall
that
the
instruction
means
moving
to
the
right.
1
What
are
the
coordinates
of
the
starting
point
of
the
plot?
2
How
many
triangles
are
drawn
by
the
script?
3
a
What
is
the
length
(in
pixels)
of
the
side
of
the
sec-ond
drawn
triangle?
b
Freehand
draw
the
look
of
the
figure
obtained
when
this
script
is
run.
4
We
modify
the
original
script
to
obtain
the
figure
below
:
State
the
number
of
a
statement
in
the
script
after
which
can
be
placed
:
to
get
this
new
figure.
E.7618
Here
are
three
different
figures,
none
of
which
are
to
the
scale
shown
in
the
exercise:
The
program
below
contains
a
variable
named
ˇ
length
ı.
Recall
that
the
instruction
means
to
move
to
the
right
with
the
pen.
1
a
Draw
the
figure
obtained
with
the
block
ˇ
one
turn
ı
given
in
the
right
frame
above,
for
a
starting
length
equal
to
30
,
being
oriented
to
the
right
with
the
pen,
at
the
beginning
of
the
plot.
We
will
take
1
cm
for
30
units
of
length,
i.e.
30
pixels.
b
How
are
we
oriented
with
the
pen
after
this
plot?
(no
justification
is
required)
.
2
Which
of
the
figures
1
or
3
does
the
above
program
pro-duce?
Justify
your
answer.
https://chingmath.fr
sacados/7615
s’orienter à90
quandest cliquée∑acer toutaller à x:-200y:-100s’orienter à90Mettrecôtéà100triangleavancer decôtéAjouter àcôté-20répéter5fois123457896
dé∏nir trianglestylo en position écritureavancer decôtétournerde120degrésrépéter3foisrelever le stylo123456
tournerde60degrés
sacados/7618
Figure 1Figure 2Figure 3
quandest cliquécacheraller à x:0y:0s’orienter à90degrésmettrelongueurà90e∑acer toutmettre la taille du stylo à3stylo en position d’écritureun tourajouter àlongueur30répéter2foisDé∏nir un touravancer delongueurtournerde90degésrépéter2foisajouter àlongueur30avancer delongueurtournerde90degrésrépéter2fois
s’orienter à90degrés
quandestcliquécachermettrelatailledustyloà2alleràx:-240y:0e∑acertoutstyloenpositionécritures’orienterà90maisonavancerde20répéternfoisde∏nirmaisontournerde90degrésavancerde50tournerde45degrésavancerde50tournerde90degrésavancerde50tournerde45degrésavancerde50tournerde90degréstracédela"maison".d
CMHEA30oCeschéman’estpasenvraiegrandeur
dé∏nir carréstylo en position écritureavancer delongueurtournerde90degrésrépéter4foisrelever le stylo
quandest cliquémettrelongueurà10carrémettrelongueuràlongueur+20répéter4foiscacherProgramme no1
quandest cliquémettrelongueurà10carrémettrelongueuràlongueur*2répéter4foiscacherProgramme no2
Dessin no1Dessin no2Dessin no3
E.7613
For
a
ˇ
rue
ı,
we
defined
the
layout
of
a
ˇmaisonı.
1
Check
that
d
is
approximately
equal
to
71
to
the
nearest
unit.
2
A
point
in
your
program’s
execution
window
has
its
ab-scissa
that
can
vary
from
−
240
to
240
and
its
ordinate
that
can
vary
from
−
180
to
180
.
What
is
the
largest,
integer
n
that
can
be
used
in
the
main
program
to
make
the
ˇrueı
plot
fit
in
your
com-puter
window
o
where
the
prgram
runs?
You
can
draw
on
your
copy
all
the
diagrams
(freehand
or
not)
that
have
been
used
to
answer
the
previous
ques-tion
and
add
any
useful
information
(values,
encodings,
additional
features,
point
names.
.
.
)
3
Please
note,
this
question
is
independent
of
the
pr{ecédentes
questions
and
the
ˇ
maison
ı
is
slightly
dif-ferent.
If
you
want
to
add
a
chimney
outlet
to
the
layout
of
the
house
to
make
it
more
realistic,
you
need
to
do
a
mini-mum
of
calculations
to
avoid
any
surprises.
Examples
:
It
is
assumed
that
:
points
H
,
E
and
A
are
aligned
;
points
C
,
M
and
A
are
aligned
;
[
CH
]
and
[
EM
]
are
perpendicular
to
[
HA
]
;
AM
=
16
MC
=
10
∠
HAC
=
30
o
Calculate
EM
,
HC
and
HE
in
order
to
get
a
nice
chim-ney
exit.
E.7619
The
instruction
block
ˇ
square
ı
opposite
has
been
programmed
and
then
used
in
the
two
programs
below
:
The
instruction
ˇ
move
forward
by
10
ı
moves
the
sprite
forward
by
10
pix-els.
1
Here
are
three
drawings
:
a
Which
of
these
three
drawings
do
you
get
with
the
program
n
o
1?
b
Which
of
these
three
drawings
do
we
obtain
with
the
program
n
o
2?
c
For
each
of
the
two
programs,
determine
the
lengths,
in
pixels,
of
the
side
of
the
largest
square
drawn?
2
We
wish
to
modify
the
program
n
o
2
to
obtain
the
draw-ing
below
:
Which
of
the
following
three
modifications
produces
the
desired
drawing?
No
justification
is
required
for
this
question.
https://chingmath.fr
sacados/7613
quandestcliquécachermettrelatailledustyloà2alleràx:-240y:0e∑acertoutstyloenpositionécritures’orienterà90maisonavancerde20répéternfoisde∏nirmaisontournerde90degrésavancerde50tournerde45degrésavancerde50tournerde90degrésavancerde50tournerde45degrésavancerde50tournerde90degréstracédela"maison".d
CMHEA30oCeschéman’estpasenvraiegrandeur
sacados/7619
dé∏nir carréstylo en position écritureavancer delongueurtournerde90degrésrépéter4foisrelever le stylo
quandest cliquémettrelongueurà10carrémettrelongueuràlongueur+20répéter4foiscacherProgramme no1
quandest cliquémettrelongueurà10carrémettrelongueuràlongueur*2répéter4foiscacherProgramme no2
Dessin no1Dessin no2Dessin no3
Modi∏cation1quandestcliquémettrelongueurà10carréavancerdelongueur+10mettrelongueuràlongueur*2répéter4foiscacherModi∏cation2quandestcliquémettrelongueurà10carrémettrelongueuràlongueur*2avancerdelongueur+10répéter4foiscacherModi∏cation3quandestcliquémettrelongueurà10carrémettrelongueuràlongueur*2répéter4foisavancerdelongueur+10cacher
Pointdedépart6030o150o
dé∏nir Losangestylo en position d’écritureavancer detournerde30degrésavancer detournerde150degrésavancer detournerdedegrésavancer detournerdedegrésrelever le stylo
s’orienter à90degrés
quandest cliquée∑acer toutaller à x:0y:0s’orienter à90degrésrépéter12fois
tournerde30degrés
losange
tournerde150degrés
avancer de600
Profondeurd’unemarcheHauteurd’unemarche
E.7620
1
We’d
like
to
draw
the
diamond-shaped
pattern
below.
Complete
the
Losange
block
script
to
obtain
this
pattern.
The
pattern
Losange
Le
block
Losange
2
We
want
to
make
the
figure
below
constructed
from
the
Losange
block
completed
in
question
1
.
Remember
that
the
instruc-tion
means
we’re
heading
to
the
right.
From
the
instructions
below,
indicate
on
your
copy,
in
or-der,
the
two
instructions
to
be
placed
in
the
loop
opposite
to
finish
the
script.
a
b
c
d
E.10683
We
want
to
make
a
wooden
stair-case
of
height
272
cm
.
The
height
of
a
step
is
17
cm
.
The
depth
of
a
step
for
placing
the
foot
measures
27
cm
.
1
How
many
steps
should
be
built?
2
We
write
the
program
below
with
Scratch
software
to
de-sign
this
staircase.
(
1
cm
in
reality
is
represented
by
1
by
in
the
program.)
Copy
lines
5
,
6
,
7
and
9
,
completing
them.
3.
Algorithm
and
conditional
E.7614
We
consider
the
following
calcula-tion
program
:
Choose
a
number;
Multiply
it
by
−
4
;
Add
5
to
the
result.
1
Verify
that
when
we
choose
−
2
with
this
program,
we
https://chingmath.fr
Modi∏cation1quandestcliquémettrelongueurà10carréavancerdelongueur+10mettrelongueuràlongueur*2répéter4foiscacherModi∏cation2quandestcliquémettrelongueurà10carrémettrelongueuràlongueur*2avancerdelongueur+10répéter4foiscacherModi∏cation3quandestcliquémettrelongueurà10carrémettrelongueuràlongueur*2répéter4foisavancerdelongueur+10cacher
sacados/7620
Pointdedépart6030o150o
dé∏nir Losangestylo en position d’écritureavancer detournerde30degrésavancer detournerde150degrésavancer detournerdedegrésavancer detournerdedegrésrelever le stylo
s’orienter à90degrés
quandest cliquée∑acer toutaller à x:0y:0s’orienter à90degrésrépéter12fois
tournerde30degrés
losange
tournerde150degrés
avancer de600
sacados/10683
Profondeurd’unemarcheHauteurd’unemarche
sacados/7614
quandest cliquédemanderChoisir un nombreet attendresi-4×réponse+5<0alorsdireBravodireEssaie encoresinon
OChat
quandestcliquéDépartQuandπèchegaucheestcliquéajouter-40àxQuandπèchedroiteestcliquéajouter80àxQuandπèchehautestcliquéajouter80àyQuandπèchebasestcliquéajouter-40àyQuandn’importequoiestcliquédireJet’aiattrapépendant2secondesDépartSiBalletouchéealors
get
13
.
2
What
number
should
we
choose
at
the
start
to
get
−
3
?
3
Salome
has
the
following
script
run
:
a
What
will
the
sprite’s
answer
be
if
she
chooses
the
number
12
?
b
What
will
be
the
sprite’s
answer
if
she
chooses
the
number
−
5
?
4
The
above
calculation
program
can
be
translated
into
the
literal
expression
−
4
·
x
+5
with
x
representing
the
chosen
number.
Solve
the
following
inequation
:
−
4
·
x
+5
<
0
5
Under
what
condition,
pertaining
to
the
chosen
number,
is
it
certain
that
the
sprite’s
answer
will
be
ˇ
Bravo
ı?
4.
Event
programming
E.7612
The
image
below
shows
the
position
obtained
when
the
start
block
of
a
game
program
is
triggered.
The
background
is
made
up
of
dots
spaced
40
units.
In
this
position,
the
cat’s
coordi-nates
are
(
−
120
;
−
80)
.
The
object
of
the
game
is
to
position
the
cat
on
the
ball.
1
What
are
the
coordinates
of
the
center
of
the
ball
shown
in
this
position?
2
In
this
question,
the
cat
is
in
the
position
obtained
when
the
start
block
is
triggered.
Here’s
the
script
for
the
ˇ
chat
ı
moving
sprite.
a
Explain
why
the
cat
does
not
return
to
its
starting
po-sition
if
the
player
presses
the
→
key
and
then
the
←
key.
b
The
player
presses
the
following
succession
of
keys
:
→
→
↑
←
↓
c
Which
of
the
following
key
sequence
proposals
allows
the
cat
to
reach
the
ball?
Move
1
Move
2
Move
3
→→→→→→→↑↑↑↑↑
→→→↑↑↑→↑←
↑←↑←↑←←↓↓
3
What
happens
when
the
cat
hits
the
ball?
https://chingmath.fr
quandest cliquédemanderChoisir un nombreet attendresi-4×réponse+5<0alorsdireBravodireEssaie encoresinon
sacados/7612
OChat
quandestcliquéDépartQuandπèchegaucheestcliquéajouter-40àxQuandπèchedroiteestcliquéajouter80àxQuandπèchehautestcliquéajouter80àyQuandπèchebasestcliquéajouter-40àyQuandn’importequoiestcliquédireJet’aiattrapépendant2secondesDépartSiBalletouchéealors
quandestcliquéinitialisationquandπechehautestcliqués’orienterà0styloenpositiond’écritureavancerde50releverlestyloquandπechedroiteestcliqués’orienterà90styloenpositiond’écritureavancerde50releverlestyloquandπechebasestcliqués’orienterà180styloenpositiond’écritureavancerde50releverlestylo
initialisation
s’orienter à9090 à droite-90 à gauche0 vers le haut180 vers le bas
Dessin 1Dessin 2Dessin 3
quandestcliquéinitialisationquandπechehautestcliqués’orienterà0styloenpositiond’écritureavancerde50releverlestyloquandπechedroiteestcliqués’orienterà90avancerde50quandπechebasestcliqués’orienterà180styloenpositiond’écritureavancerde50releverlestylo
FHCible-100-50050100-100-5050100
E.7616
Margot
has
written
the
following
program.
It
allows
to
draw
with
three
keys
of
the
keyboard.
For
information
This
block
erases
the
pre-vious
drawing,
posi-tions
the
pen
to
the
left
of
the
screen,
and
raises
the
pen.
1
Of
the
following
three
designs,
only
one
will
not
be
pos-sible
with
this
program.
Which
one?
Explain.
2
Julie
has
modified
Margot’s
program
(see
below)
.
What
then
does
drawing
3
become
with
Julie’s
modified
pro-gram?
5.
Unclassified
exercises
E.7965
Throughout
the
exercise,
the
unit
of
length
is
the
mm
.
A
dart
is
thrown
at
a
square
plate
with
a
circular
target
(gray
in
the
figure)
.
If
the
point
of
the
dart
is
on
the
edge
of
the
target,
the
target
is
considered
not
hit.
This
experiment
is
considered
random
and
we
are
interested
in
the
probability
that
the
dart
hits
the
target.
the
length
of
the
square
plate
side
is
200
.
the
radius
of
the
target
is
100
.
the
dart
is
represented
by
the
point
F
of
coordinates
(
x
;
y
)
where
x
and
y
are
random
numbers
between
−
100
and
100
.
1
In
the
example
above,
the
dart
F
is
located
at
the
coor-dinate
point
(72
;
54)
.
Show
that
the
distance
OF
,
between
the
dart
and
the
origin
of
the
reference
frame
is
90
.
2
Generally
speaking,
what
number
must
not
exceed
the
distance
OF
for
the
dart
to
hit
the
target?
3
A
program
is
made
that
simulates
throwing
this
dart
at
the
square
plate
several
times
and
counts
the
number
of
throws
hitting
the
target.
The
programmer
has
cre-ated
three
variables
named
:
square
OF
,
distance
and
score
.
https://chingmath.fr
sacados/7616
Asie
Juin 2017
4 points
quandestcliquéinitialisationquandπechehautestcliqués’orienterà0styloenpositiond’écritureavancerde50releverlestyloquandπechedroiteestcliqués’orienterà90styloenpositiond’écritureavancerde50releverlestyloquandπechebasestcliqués’orienterà180styloenpositiond’écritureavancerde50releverlestylo
initialisation
s’orienter à9090 à droite-90 à gauche0 vers le haut180 vers le bas
Dessin 1Dessin 2Dessin 3
quandestcliquéinitialisationquandπechehautestcliqués’orienterà0styloenpositiond’écritureavancerde50releverlestyloquandπechedroiteestcliqués’orienterà90avancerde50quandπechebasestcliqués’orienterà180styloenpositiond’écritureavancerde50releverlestylo
sacados/7965
FHCible-100-50050100-100-5050100
quandestcliquémettrescoreà0alleràx:nombrealéatoireentre-100et100y:nombrealéatoireentre-100et100mettreCarrédeOFàabscissex*abscissex+mettredistanceàracinedeajouteàscore1Sidistance<...alorsrépéter120fois
Pointdedépartdutracé
quandest cliqués’orienter à90e∑acer toutstylo en position d’écritureavancer de80tournerde144degrésavancer de80tournerde72degrésrépéterfoisrelever le stylo
s’orienter à90
avancer de80tournerde144degrésavancer de80tournerde72degrésrépéterfois
a
When
running
this
program,
how
many
throws
are
sim-ulated?
b
What
is
the
role
of
the
variable
score
?
c
Complete
and
copy
on
the
copy
only
the
5
,
6
,
and
7
lines
of
the
program
so
that
it
works
correctly.
d
After
one
run
of
the
program,
the
variable
score
is
equal
to
102
.
How
often
was
the
target
reached
in
this
simulation?
Express
the
result
as
an
irreducible
fraction?
4
Assume
that
the
probability
of
hitting
the
target
is
equal
to
the
quotient
:
area
of
the
target
divided
by
area
of
the
square
plate.
Give
a
value
of
this
probability
approximated
to
the
near-est
hundredth.
E.7968
Arthur
has
to
write
a
program
with
Scratch
to
draw
a
star
like
the
draw-ing
shown
opposite.
His
program
is
missing
the
number
of
repetitions.
Programme
commencé
par
Arthur
Information
The
instruction
means
moving
to
the
right
1
What
number
must
he
enter
in
the
double
ˇ
repeat
ı
to
get
the
star?
2
Determine
the
perimeter
of
this
star.
3
Arthur
wishes
to
enlarge
this
star
to
obtain
a
star
whose
perimeter
would
be
double,
by
modifying
his
program.
Copy
the
part
of
the
pro-gram
opposite
onto
the
copy,
modifying
the
val-ues
required
to
obtain
this
new
star.
https://chingmath.fr
quandestcliquémettrescoreà0alleràx:nombrealéatoireentre-100et100y:nombrealéatoireentre-100et100mettreCarrédeOFàabscissex*abscissex+mettredistanceàracinedeajouteàscore1Sidistance<...alorsrépéter120fois
sacados/7968
Asie
Juin 2018
Pointdedépartdutracé
quandest cliqués’orienter à90e∑acer toutstylo en position d’écritureavancer de80tournerde144degrésavancer de80tournerde72degrésrépéterfoisrelever le stylo
s’orienter à90
avancer de80tournerde144degrésavancer de80tournerde72degrésrépéterfois
quandest cliquéaller à x:0y:0stylo en position d’écritures’orienter à90degrémettreLongueurà 300CarréTriangleavancer deLongueur/6mettreLongueuràCarréTriangle
Dé∏nir Carréavancer deLongueurtournerde90degrésrépéter4fois
Dé∏nir Triangleavancer deLongueurtournerde120degrésrépéter3fois
quandest cliquédemanderChoisissez un nombreet attendreenvoyer à tousle nombre a été saisimettreNombreàréponsemettreRésultat 1à2*Nombre+3mettreRésultat 1àRésultat 1*Résultat 1direregroupele résultat 2 estRésultat 2
quand je reçoisle nombre a été saisimettreRésultat 2àNombre*NombremettreRésultat 2àRésultat 2*4mettreRésultat 2àRésultat 2+12*NombremettreRésultat 2àRésultat 2+9attendre3secondedireregroupele résultat 2 estRésultat 2
le résultat 2 est9
E.7969
The
lengths
are
in
pixels.
The
expression
ˇ
orienting
at
90
ı
means
orienting
to
the
right.
The
following
program
is
given
:
1
We
take
1
cm
as
the
scale
for
50
pixels.
a
Show
on
your
copy
the
figure
obtained
if
the
program
is
run
up
to
and
including
the
line
7
.
b
What
are
the
coordinates
of
the
pen
after
line
8
is
ex-ecuted?
2
We
run
the
full
program
and
get
the
figure
below
that
has
a
vertical
axis
of
symmetry.
Copy
and
complete
the
9
line
of
the
program
to
obtain
this
figure.
3
a
Which
of
the
following
transformations,
translation,
homothety,
rotation,
symmetry,
axial,
is
the
geometric
transformation
that
yields
the
small
square
from
the
large
square?
Specify
the
reduction
ratio.
b
What
is
the
ratio
of
areas
between
the
two
squares
drawn?
E.7974
Here
is
a
script
entered
by
Alice
in
an
algorithmic
software.
1
Alice
chose
3
as
her
number,
calculate
the
values
of
ˇ
Re-sult
1
ı
and
ˇ
Result
2
ı?
Justify
by
showing
the
calculations
made
2
Generalization:
a
Calling
x
the
number
chosen
in
the
algorithm,
give
a
literal
expression
translating
the
first
part
of
the
algo-rithm
corresponding
to
ˇ
Result
1
ı.
b
Calling
x
the
number
chosen
in
the
algorithm,
give
a
literal
expression
translating
the
second
part
of
the
algorithm
corresponds
to
ˇ
Result
2
ı.
c
Find
the
number
or
numbers
chosen
by
Alice
that
match
the
result
shown
below
:
https://chingmath.fr
sacados/7969
quandest cliquéaller à x:0y:0stylo en position d’écritures’orienter à90degrémettreLongueurà 300CarréTriangleavancer deLongueur/6mettreLongueuràCarréTriangle
Dé∏nir Carréavancer deLongueurtournerde90degrésrépéter4fois
Dé∏nir Triangleavancer deLongueurtournerde120degrésrépéter3fois
sacados/7974
quandest cliquédemanderChoisissez un nombreet attendreenvoyer à tousle nombre a été saisimettreNombreàréponsemettreRésultat 1à2*Nombre+3mettreRésultat 1àRésultat 1*Résultat 1direregroupele résultat 2 estRésultat 2
quand je reçoisle nombre a été saisimettreRésultat 2àNombre*NombremettreRésultat 2àRésultat 2*4mettreRésultat 2àRésultat 2+12*NombremettreRésultat 2àRésultat 2+9attendre3secondedireregroupele résultat 2 estRésultat 2
le résultat 2 est9