Sei sulla pagina 1di 7

Ministerul Educaţiei, Culturii și Cercetării al Republicii Moldova

Universitatea Tehnică a Moldovei


Catedra Ingineria Software şi Automatică

RAPORT
Lucrarea de laborator nr.4
la Programarea Calculatoarelor

A efectuat:
st. gr. FAF-171 Țîrdea Nicoleta

A verificat:
dr., conf.univ. M. Kulev

Chişinău -2017
Laboratory work nr.4
Topic: 1-D Array

Purpose of the work: Studying and using the basic language instructions
for the processing and modification of unidimensional massifs.
Topic description : 1-D array -it is a string of uniformly arranged elements in a
row. Every element of a one-dimensional massive has a coordinate (serial
number in massif)

Problem condition (task): To write a program that will process whole vectors.
Option 10 : Are given two unidimensional array F [n] andG [n]. Calculate the
value of the expression T = eS / K+ (S * K), where: S is the sum of the elements
on the odd positions of mass F, and K - quantity of the elements in odd
positions of the massive G.

Running mode: To insert, process, and display a one-dimensional vector


you will have to go through all of its elements from the original position
to the final one.

Flowchart:
*The Flowchart of the program can be seen on the next page
Code of programm:

Testing and verification :


To test and verify the correct execution of the program I individually analyzed
the matrix data and the compliance with the problem condition and I noticed
that the program is running correctly.
Analysis of the results and conclusions:
Iteration in a program is the act of repeating a part of an algorithm or the
whole program for a defined number of repetitions. Each repetition of the
process is also called an "iteration", and the results of one iteration are
used as the starting point for the next iteration.

1. Practical skills of developing and debugging different cyclic program for


were obtained.
2. Increase in productivity by allowing multiple programmers to work on
different parts of the project independently at the same time.
3. Disadvantage: Change of even a single data structure in a program
necessitates changes at many places throughout it, and hence the changes
becomes very difficult to track even in a reasonable sized program.
4. In order to corect this disadvantage we can use in future the random array
generator function and to use pointers to manage the memory given for
variables.

Bibliography:
1. Derevlenco, Vasile și alț. Programare : Indicaţii de laborator. Partea 1. –
Ch.: Tehnica – UTM, 2014. http://library.utm.md
2. https://www.programiz.com/cpp-programming/do-while-loop
3. https://www.wolframalpha.com/

Potrebbero piacerti anche