
Exercises and problems in Informatics December 2001 
I. 10. Suppose we know the positions of N sticks
placed onto a field. Our aim is to encircle the area these sticks
occupy with a single rope from outside. (Of course, in general not all
sticks will be touching the encircling rope.) Write a program that
reads the number N, and both coordinates x and y
of each of the N sticks, then prints the length of rope needed
to encircle the area. (10 points)
I. 11 Write a program that simulates the orbit of a
planet around our Sun. The Sun is to be placed in the middle of the
screen, its position is fixed throughout the simulation, and its mass
is denoted by N. We know the instantaneous position
(X,Y) of the planet, its mass B, further its
velocity vector V (perpendicular to the straight line
connecting the Sun and the planet). The program should compute the
position of the planet in each time step T, according to its
original position, velocity vector and the forces acting on it. Your
program should read the values N, X, Y, B,
V and T, then draw the orbit of the planet.
(10 points)
I. 12. Numbers having very many digits (e.g. 100) can
not be added together or multiplied by Excel, therefore one should
look for an alternative solution. These large numbers can be
represented, for example, by writing only one digit into each cell,
however, addition and multiplication should be devised for numbers of
this form. Prepare a sheet to add and multiply two numbers which have
been entered into the first two rows, and having at most 100
digitsone digit per cell. The product can not have more than 100
digits either. During the solution of the problem, you are only
allowed to use the first seven rows and 201 columns of the sheet. The
following example shows a solution for numbers having at most 10
digits:
 A  B  C  D  E  F  G  H  I  J  K 
1  Number 1:         1  5  3 
2  Number 2:         4  5  6 
3            
4            
5            
6  Sum:         6  0  9 
7  Product:       6  9  7  6  8 

Send your solutions to the following email address:
Deadline: 13 January 2002
