You are on page 1of 7

Information units Conversion table hexadecimal – binary

hexadecimal binary hexadecimal binary


1 bit – elementary unit 0 0000 8 1000
1B (Byte) = 8 bits 1 0001 9 1001
1KB ( Kilobyte) = 210 B (≈ 1000 B) 2 0010 A 1010
1MB (Megabyte) = 210 KB (≈ 1000 KB) 3 0011 B 1011
1GB (Gigabyte) = 210 MB (≈ 1000 MB) 4 0100 C 1100
1TB (Terabyte) = 210 GB (≈ 1000 GB) 5 0101 D 1101
6 0110 E 1110
7 0111 F 1111

HTML codes for Romanian letters:


Letter Ă ă Â â Î î Ş ş Ţ ţ
Code &#258 &#259 &Acirc &acirc &Icirc &icirc &#350 &#351 &#354 &#355

Memory allocation in Turbo Pascal 7.0 Conversion table octal – binary


Octal binary
Type Bytes 0 000
1 001
integer 2
2 010
real 6
3 011
boolean 1 4 100
char 1 5 101
enumeration 1 6 110
interval In correspondence with the basic type 7 111
reference 4
string 256
Nr Item Score
1. In the Image 1 are presented 24 runes (letters) of the Futhark L L
alphabet, used by ancient inhabitants of Scandinavia. The runes 0 0
are considered the set of messages of a source. They are 1 1
encoded by binary words of equal length. 2 2
3 3
a) Calculate and write in the space reserved for the answer the 4 4
smallest length of binary words, sufficient to unequivocally 5 5
encode and decode of the source messages. Image 1
Write the used formulas and the calculations: Answer: ________

b) Image 1 is a 16x16 cm monochrome image rendered with a raster of 128 dots/cm. The
number of luminance levels is equal to 64. Calculate and write in the space reserved for the
answer the amount of information (in MB) which is contained in the given image.
Answer: _________MB
Write the used formulas and the calculations:

2. a) The ”black box” converts the numbers from the input, written in the decimal base into L L
another base. Determine this base. 0 0
(39)10 (54)x 1 1
2 2
Write calculations: 3 3
4 4
5 5
Answer: x=______ 6 6
b) Represent the real number (-0,375)10 in fixed-point in direct code on 8 binary positions.
Write the answer in the cassette below.
Answer:
Write calculations:

c) Write in the space reserved for the answer the greatest digit of the ternary numeration
system (base 3). Answer: _________

3. Image 2 represents a scheme of a logic circuit: b) Let the input values of the L L
independent variables are given: 0 0
x1  0, x2  1, x3  1 1 1
2 2
Write in the spaces marked by on 3 3
the Image 2 the logic values obtained 4 4
after each logical gate. 5 5
6 6
c) Write the formula of the logical fun-
Image 2 ction y2 , presented in the logic circuit
a) Check the type of the given circuit: on the Image 2:
 sequential  combinational y2  _________________________
4. Let ABC is a triangle with the sides length a, b and c. The area of this triangle can be calculated L L
using the Heron’s formula: 0 0
abc 1 1
sABC  p( p  a)( p  b)( p  c) , where p  . 2 2
2
3 3
Write a subprogram named ARIA, that receives as parameters three real numbers – the lengths
4 4
of the sides of the triangle ABC - a, b, c, and returns the area of the given triangle, calculated
5 5
using the Heron’s formula.
Note: the numbers a, b and c are considered to satisfy the relations of the length of the sides of
a triangle.

5. Let the following Pascal program is given: Perform the following tasks for the program L L
Program Item5; Item5: 0 0
Type V=array[1..20] of integer; 1 1
var a : ^V; n, k ,i: integer; a) Write the name of the actual parameters 2 2
in the call of the subprogram G: 3 3
__________. 4 4
Procedure G(m:integer; var t:V);
var i:integer; b) Underline the call of the subprogram Q 5 5
in the program Item5. 6 6
begin
for i:=1 to m do c) Write the names of the local variables 7 7
{1}if i mod 2=1 then t[i]:=1 declared in the program Item5:
{2} else t[i]:=i div 2+1; _______________________.
end; d) Calculate and write the number of
elementary operations performed during
Function Q(x:integer):integer; the execution of the instruction preceded
var s, j: integer; by the comments {1} and {2}:
begin _______
Note:
s:=0;
If E then I1
for j:=1 to x do QE+max{QI1, QI2}+1
else I2
s:=s+j;
Q:=s; e) Calculate and write the greatest amount
end; of memory allocated in the HEAP:
______В.
begin f) Write the instruction used in the program
n:=5; Item5 for creating the dynamic
new(a); variable: _________
G(n,a^); g) Write what will be printed after the
for i:=1 to n do execution of the program Item5:
if a^[i]>1 _______________________________
then write(Q(a^[i]),' ');
dispose(a);
end.
6 The Book Exhibition for children and youth took place for 4 days. Each day the visitors bought L L
books from N publishing houses, numbered from 1 to N. 0 0
1 1
Task: Write a program that determines the index of the publishing house that had sold the 2 2
greatest number of books during these 4 days. The program must contain a subprogram 3 3
named CR, that receives from the main program as a parameter an integer number i – the 4 4
index of the publishing house, and returns an integer number – the total number of books sold 5 5
6 6
by the publishing house i.
7 7
Input: The text file carte.in contains in the first line the integer number N(1≤N≤30). 8 8
Each of the following N lines contain 4 integer numbers, separated by spaces. The line i+1 9 9
contains the number of books sold by the publishing house i during each of the 4 days of the 10 10
Book Exhibition.
Output: The text file carte.out contains in a line an integer number – the index of the
publishing house that had sold the greatest number of books during the Book Exhibition.
Note. There are no two publishing houses with the same number of sold books.
Example: carte.in carte.out The solution will be appreciated
4 2 for: types and variables declaration;
100 87 200 53 operations with text files; reading
200 150 149 300 and writing data; algorithms
250 100 100 122 organization.
68 133 101 88
7 The contour of a field is determined by: L L
 lines x  1 and x  1 ; 0 0
 the graph of the function f ( x)  x3  1.5 1 1
2 2
 the axis OX. 3 3
Write a program that calculates the area of the field. The approximative 4 4
calculation of the area is performed using the method of left rectangles 5 5
for the known number of the divisions of the segment: n=50. 6 6
Input: The values of the extremities of the integration interval and the
number of its divisions are directly attributed in the
program. The algorithm of the method:
Step_1: The values of the extrimities of
Output: A real number will be displayed on the the integration segment a, b and the
screen – the area of the field. number of divisons n are introduced.
Step 2: The length of the elementary
segment is calculated
ba
h ; S  0;
n
Step 3: For all i from 0 to n-1:
a) Are calculated the values
xi  a  ih;
b) It is calculated the area of the
elementary rectangle
Si  h  f ( xi )
c) The calculated area is added to the
previous areas: S  S  Si
Step 4: The total calculated area is
displayed.
8 A database has been created in MS Access. In the Image 3 are presented fragments of the L L
current content of the database tables: 0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9

Image 3
Based on the content of the database tables, perform the following tasks:
a) In the Image 4 fill in all the necessary elements, including the relation between the
tables, to define in Design View a query which:
 displays the fields: AdrElec, DenMob, Reducere and DtEx;
 selects only the records concerning the objects that have discounts (the field
Reduceri);
 creates a resultant field named DtEx that determines the date of the execution of the
order; Resultant field is calculated by adding data from field TermEx to data from field
DtCom
 sorts the records alphabetically by the values of the field AdrElec.

Image 4
b) Check the possible type of the field AdrElec of the table Clienti:
 Yes/No  OLE Object  Hyperlink
c) Check the value of truth of the sentence:
The values of the primary key field can be repeated.
 True  False
9 Write a fragment of HTML code, which will generate in the browser window a table similar to L L
the one from the Image 5. 0 0
1 1
Note:
2 2
 Physical dimensions of the table and of 3 3
the image will not be described. 4 4
5 5
 The HTML cod and the image are in the
6 6
same folder.
7 7
 The image name is Vacanta.gif. 8 8
9 9
 The second and the third cells of the 10 10
first column contain ordered lists. Image 5

You might also like