Examen d`informatique – module INF11a, INF11b 1 session 2015

Transcription

Examen d`informatique – module INF11a, INF11b 1 session 2015
Examen d'informatique – module INF11a, INF11b
1st session 2015-2016: 2 hour test
no extra documents allowed, no calculator
Mini-guide at the end of the questions
Points scale is subject to change
In multiple-choice questions, there might be more than one valid choice. The absence of response or
an incomplete response will be considered as a wrong response.
Papers to give back at the end of the test
(1) The synthetic response sheet where you write down your answers
(2) One examination paper sheet in which you will put the response sheet.
CONTEXT
This test subject is related to the study led by F. Castinetti et al. As shown in article [1]. The subject
consists in two idependant parts. The first one, focused on algorithms, is about data analysis. The
second one focuses on a mini-website to show the results.
[1] An observational study on adrenal insufficiency in a French tertiary centre: Real life versus theory,
http://www.ncbi.nlm.nih.gov/pubmed/25617904
PART I – Algorithms (6 points)
The study conducted in [1] is about treatments for adrenal insufficiency – primary (P) and
secondary (S). In the rest of the test, we focus on a subset of the data acquired during the study.
Colums 1 to 3 represent the patient’s data : age as of December 31st, 2014, sex, and the cause of
insufficiency (marked as P or S). Column 4 marks whether the patient is still being treated
(VRAI/True or FAUX/False). The next columns represent the age of the patient when the
medication was changed. The number of medication changes is not the same accross patients.
Fig. 1 : dummy data that represent the study
The study includes 201 patients. Let Question1 be the algorithm that computes the number of
patients with a primary adrenal insufficiency and writes the result page 2, line 1, column 1
1
Q1. On the synthetic response sheet, fill in the algorithm « Question1».
Algo Question1
Début
i : integer {compteur}
nbP : integer {To count the number of « P » patients}
__(a)___________________________
For i = ___(b1)___ à ___(b2)___
If Cell(____(c1)_____) = ____(c2)_____ Then
______(d)_____________________
End if
End For
Feuil2.Cell(1,1)<- ____(e)_______________
Fin
Before going further in data processing, data consistency must be checked. In this case, all the ages
where the medication was changed must be less than the current patient’s age. It is assumed that
there were at most 20 times when medication was changed
Let « Verif» be the algorithm that goes through all columns of each line and highlights in a red
background all cells with invalid data – that is, cells where values are superior to the value column
1, same line.
Q2. On the synthetic response sheet, fill in the algorithm « Verif».
Algo Verif
Début
i,j : integer {counter}
For i = ___(f)________________ {for all lines}
For j = ____(g)____________ {for the 20 data columns}
If Cell(_____(h)_______) > Cell(______(k)______) then
Fill Cell(___(l)________) in Red
End if
End For
End For
Fin
Let « Dernier» be a function with parameters which takes as a single parameter a line number L
and that returns the age of the patient his age where the medication was last changed. The idea is to
start reading data at column 5 until the last value is found. This is the value returned by the function
Q3. On the synthetic response sheet, fill in the algorithm « Dernier».
Algo Dernier(______(m)__________) : integer
Début
i : integer {counter}
i <- ___(n)_______
While ______(o)____________________
_____(p)___________________________
End While
____(q1)__________ <- Cell(____(q2)______)
Fin
2
Let « DureeTraitement » be the algorithm that formats data on sheet 2 (Feuil2) so that the duration
of the medicated treatment can be compared. For each line
from 2 to 202 of the first sheet (Feuil1), this algorithm :
1. Copies on Feuil2 the first 4 columns of Feuil1
2. In column 5, writes the duration of the medicated
treatment. This duration is computed as the difference
between the age of the patient when the medication
was last changed and the age given column 5 of the
first sheet, plus 1.
Fig2. Résultat attendu page 2
Q4. On the synthetic response sheet, fill in the algorithm « DureeTraitement».
Algo DureeTraitement
Début
i,j : integer {counters}
For i = 2 à ___(r)___
For j = 1 à ___(s)_____
Feuil2.Cell(i,j) <- Feuil1.____(t)______
End For
Feuil2.Cell(__(u)__) = Dernier(___(v)__) - Feuil1.__(w)__ + 1
End For
Fin
PART II – Website (14 points)
Q5. Write the name of a computer Protocol used to exchanged files and explain its use in one short
sentence.
Q6. Write the name of an application that displays HTML pages (many possible answers, just write
one).
Q7. What is a URL ?
1. A programming language
2. A language that describes webpages
3. A protocol
4. A way to identify resources on the Internet (such as: documents, images)
5. An identification number for computers connected to the internet
6. None of the answers above
Q8. What is a cookie for computers ?
1. A text file
2. A program
3. A spying software
4. A kind of virus
5. None of the answers above
Q9. What is the goal of the author of a phishing email ?
3
The mini-website made by two students consists in a few HTML pages, a stylesheet and some
images. It is organized as follows :
• The TOP directory contains
o Le fichier index.htm
o Le fichier style.css
o Le fichier quizz.htm
o Le dossier CONTENU
o Le dossier IMG
• The CONTENU directory contains
o Le fichier intro.htm
o Le fichier milieu.htm
o Le fichier ccl.htm
• The IMG directory contains
o Le fichier home.png
o Le fichier hydro.png
intro.htm
dossier
TOP
fichier
IMG
home.png
index.htm
style.css
CONTENU
intro.htm
hydro.png
milieu.htm
quizz.htm
ccl.htm
Fig 1 : représentation du mini-site
Q10. What is the first tag with which an HTML file starts ?
Q11. What is the use of <meta> tags?
Q12. What HTML code is used to code the letter î ?
Q13. In the index.htm page, one wants to put a link to intro.htm. In order to achieve this, the
following code is inserted : <a href="aaa">intro</a> in index.htm. What should be put
instead of "aaa" ?
Please refer to Fig. 1 for the directories hierarchy.
Q14. In the milieu.htm page, one wants to put a link to ccl.htm. In order to acheive this, the
following code is inserted : <a href="bbb">suite</a> in milieu.htm. What should be put
instead of "bbb" ?
Please refer to Fig. 1 for the directories hierarchy.
Q15. In the ccl.htm page, one wants to put a link to index.htm. In order to acheive this, the
following code is inserted : <a href="ccc">Retour</a> in ccl.htm. What should be put
instead of "ccc" ?
Please refer to Fig. 1 for the directories hierarchy.
4
Q16. In the ccl.htm page, one wants to modify the link to index.htm. Instead of clicking on the
« Retour » text, the user will now click on the home.png image. What should be put instead of
"ddd" in <a href="ccc">ddd</a> ?
Please refer to Fig. 1 for the directories hierarchy.
The displayed result of intro.htm is shown page 4.
Q17. At the bottom of intro.htm, there is a link on the text « haut de page » which scrolls back to
« Insuffisance surrénalienne ».
On the response sheet, fill in the code below to acheive this.
<a_______(a)______><h3>Insuffisance surrénalienne</h3>
...
<a_______(b)______>haut de page </a>
Q18. Which one of the code snippet below makes it possible to have the list as shown in intro.htm?
<ol>
<li>Insuffisance
chronique</li>
<ol>
<li>Primaire</li>
<li>Corticotrope</li>
<li>Physiopathologie</li>
<li>Biologie</li>
<li>Signes cliniques</li>
</ol>
<li>Insuffisance
aiguë</li>
</ol>
(a)
<ul>
<li>Insuffisance
chronique</li>
<ul>
<li>Primaire</li>
<li>Corticotrope</li>
<li>Physiopathologie</li>
<li>Biologie</li>
<li>Signes cliniques</li>
</ul>
<li>Insuffisance
aiguë</li>
</ul>
(d)
<ol>
<li>Insuffisance
chronique</li>
</ol><ol>
<li>Primaire</li>
<li>Corticotrope</li>
</ol><ol>
<li>Physiopathologie</li>
<li>Biologie</li>
<li>Signes
cliniques</li>
</ol><ol>
<li>Insuffisance aiguë</li>
</ol>
(b)
<ul>
<li>Insuffisance
chronique</li>
</ul><ul>
<li>Primaire</li>
<li>Corticotrope</li>
</ul><ul>
<li>Physiopathologie</li>
<li>Biologie</li>
<li>Signes
cliniques</li>
</ul><ul>
<li>Insuffisance aiguë</li>
</ul>
(e)
(g) aucune des réponses ci-dessus
<ol>
<li>Insuffisance
chronique</li>
<ol>
<li>Primaire</li>
<li>Corticotrope</li>
<ol>
<li>Physiopathologie</li>
<li>Biologie</li>
<li>Signes cliniques</li>
</ol>
</ol>
<li>Insuffisance
aiguë</li>
</ol>
(c)
<ul>
<li>Insuffisance
chronique</li>
<ul>
<li>Primaire</li>
<li>Corticotrope</li>
<ul>
<li>Physiopathologie</li>
<li>Biologie</li>
<li>Signes cliniques</li>
</ul>
</ul>
<li>Insuffisance
aiguë</li>
</ul>
(f)
Q19. In the response sheet, write down the code that displays the table as shown in intro.htm.
5
Q20. In order to use the style.css stylesheet in page milieu.htm, one must add
<link rel="StyleSheet" href="eee" type="text/css">
in the file intro.htm just after the <title></title> tags.
What should be put instead of "eee" ? Please refer to Fig. 1 for the directories hierarchy.
In the style.css stylesheet, the following styles are defined:
body
p
p.beau
.beau
{color:
{color:
{color:
{color:
black}
blue}
red }
cyan; }
In the ccl.htm file is the following text :
<BODY>
<P>phrase 1 </P>
<p class= beau>phrase 2 </p>
phrase 3
<p> phrase 4<span class=beau> phrase 5 </span></p>
</BODY>
Q21. What will be the color of each sentence?
In the response sheet, write down the number of the color in the following list :
1) white
2) grey
3) cyan
4) blue
5) black
6) red
Q22. The image reins.bmp which size is 800x500 as been saved in the « Bitmap 256 colors»
format. In this format, each pixel is coded in a byte.
What will be the size occupied by the image on disk, in kilobytes?
The image reins.bmp is saved in the IMG directory. In milieu.html, the image is inserted and the
following map is :
• zone 1 : coordinates 20,50,40,70 link to https://fr.wikipedia.org/wiki/Rein
• zone 2 : coordinates 100,100,200,150 link to https://www.ujf-grenoble.fr/
Q23. Write down the code of the map
In the mini-site, the file milieu2.htm is added to the CONTENU directory. This file uses the
style.css stylesheet, contains a link to index.htm and to ccl.htm.
Q24. When a browser sends a request to get the milieu2.htm page, which files will be sent by the
server?
Q25. Give a rough estimate of the time required to download a 80 Mbit file with a 500ko/s
connection? (best case scenario).
1. Less than de 5 seconds
4. 1 to 5 minutes
2. 10 à 20 seconds
5. 10 to 20 minutes
3. 30 à 50 seconds
6. none of the answers above
6
Fig. 2 the quizz.htm webpage
<html>
<head><SCRIPT>
function Calcul() {
var nbpoint;
nbpoint = 0;
if (document.test.q1[0].checked==true ______(h)______){nbpoint=nbpoint +1;}
if (document.test.cause.value=___(i)_____){nbpoint=nbpoint +1;}
if (document.test.q3[_(j)_].checked==true){nbpoint=nbpoint +1;}
alert('Vous avez ' + ____(k)____ + ' bonne(s) réponse(s)');
}
</SCRIPT></head>
<body>
<FORM NAME="test">
<P>Q1. Une insuffisance surrénale concerne :
<INPUT TYPE="__(a)___" NAME="q1"> les reins
<INPUT TYPE="__(a)___" NAME="q1"> le foi
<INPUT TYPE="__(a)___" NAME="q1"> la rate
<P>Q2. Quelle est la cause la plus fréquente des insuffisances primaires ?
<____(b)____ name="cause">
<__(c)______ value="a"> auto-immune
<__(c)______ value="b"> adénome
<__(c)______ value="c"> tuberculose
<__(c)______ value="d"> tumeur
</____(b)____>
<P>Q3.
<INPUT
<INPUT
<INPUT
Une insuffisance
TYPE="___(d)___"
TYPE="___(d)___"
TYPE="___(d)___"
chronique est aussi appelée insuffisance :
NAME="q3">aiguë
NAME="q3">primaire
NAME="q3">secondaire
<P><BR>
<input TYPE="button" value="___(e)___" onClick="___(f)___)">
<INPUT TYPE=___(g)___ VALUE="Annuler">
</body></html>
&nbsp &nbsp
Fig. 3 The incomplete quizz.htm code
Q26. In the response sheet, fill in the code Fig. 3 to get the page as shown Fig. 2 (parts a to g).
Q27. Fill in the javascript code, assuming that the expected correct answers are: (Q1) « reins »,
(Q2) « auto-immune » et (Q3) « primaire » (parties h à k).
7
________________ LEXIQUE HTML__________________
Define an algorithme
Algo Toto
Begin
…..
End
Variables declaration
t : integer
R : real
R2 : (big) real
ch : characters string
B : boolean
Affectation
T←0
Ch ← « bonjour »
B ← True ou B ← False
« For » Iteration :
For t=1 to 100 do
……….
End For
« While » iteration:
…
While (condition) do
……….
End While
Condition :
If (condition)
then
…
else
…
End if
Defining and using an algorithm with
parameters
{definition}
Algo Toto (X, Y : integer)
Begin
…..
End
{Use}
Algo essai
Begin
Toto (10, 12)
End
Defining and using a function
{definition}
Fonction Titi result (integer)
Begin
….
Titi = 12 {here the returned value is 12}
End
{Use}
Algo essai
Begin
tmp : integer
tmp = Titi ()
End
Cell(l,c) : Cell line l, column c
Cell(i,j) empty
True if Cell(i,j) is empty
Cell(i,j) not emty
A and B : true if both A and B are true
A or B : true if at least A or B is true
True if Cell(i,j) is not empty
________________ LEXIQUE JavaScript__________________
Logical and: &&
Affectation : =
Logical or : ||
True: true
Equality in a condition : ==
8
False: false
Anonymity number: ______________________________________________________
Synthetic response sheet
Q1.a)
Q1.b1)
Q1.b2)
Q1.c1)
Q1.d)
Q1.e)
Q2.f)
Q2.g)
Q2.h)
Q3.m)
Q2.k)
Q3.n)
Q1.c2)
Q2.l)
Q3.o)
Q3p)
Q3.q1)
Q4.r)
Q4.u)
Q3.q2)
Q4.s)
Q4.t)
Q3.v)
Q3.w)
Q5)
Q6.)
Q7.)
Q8.)
Q9)
Q10)
Q11)
Q12)
Q13)
Q14)
Q15)
Q16)
Q17a)
Q18)
Q17b)
9
Q19)
Q20)
Q21.Phrase1
Q21.Phrase2
Q21.Phrase3
Q21.Phrase4
Q21.Phrase5
Q22)
Q23)
Q24)
Q25)
Q26a)
Q26b)
Q26d)
Q26g)
27i)
Q26c)
Q26e)
Q26f)
Q27h)
Q27j)
27k)
10

Documents pareils