EEI Escuela de Ingeniería Industrial de Vigo: Informática para La Ingeniería 24/6/2015 Group C

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

EEI

Escuela de Ingeniería Industrial de Vigo


Informática para la Ingeniería 24/6/2015 Group C
C
Last Names Name DNI

INSTRUCCIONES
• All the questions in this test must be answered using CAPITAL LETTERS in the table at the bottom of this first page.
Answers outside of the table or that are unclear will not be taken into account.
• All the answers to this exam must be made in the stapled pages and in the reserved zones.
• Staples may not be removed and pages may not be added.
• There is only one correct answer to each test question.
• The value of the test is 3 points. Correct answers are given a score of 0.3. Incorrect answers subtract 0.15. Unanswered
questions do not score.
• The duration of the exam will be of 2 hours.
TEST
1. Given the following values A=5, B=78, C=14 y D=6. What is the result of this expression?: ((C>D) OR not(A>B)) AND ((A>B) OR not(C>D))?
A. It is not a valid expression
B. True
C. It cannot be evaluated
D. False
2. Given the following program excerpt, what is shown on the screen if A is 19?
If A>15 then
ANSWERS:
If A>=25 then
MsgBox(“GREEN”) A. GREEN
Else B. BLUE
MsgBox(“BLUE”) C. RED
End if D. YELLOW
Else
If A<=7 then
MsgBox(“RED”)
Else
MsgBox(“YELLOW”)
End if
End if
3. Given the following program, what is shown on the screen?
Module mod1 ANSWERS:
Sub Main() A. The value of b is: 6
Dim a, b as integer
Const fff as integer = 12 B. The value of b is: 7
For a=1 to fff C. The value of b is: 11
If a mod 2 =0 then D. The value of b is: 13
b=b+3 E. None of the above
Else
b=b-1
End if
Next a
MsgBox(“The value of b is: “ & b)
End sub
End module
4. What is the function of the Operating System (O.S.)?
A. The O.S. has nothing to do with managing the applications (processes) that run on the computer.
B. The O.S. is only used when the computer has problems managing memory. If not, the O.S. does not load.
C. Options A and D are correct.
D. The O.S. manages the computer’s hardware resources.
5. If I use a sequential access file. Which of the following statements is correct?
A. I can read and write in any position in the file.
B. I can read and add records at the same time.
C. I can only read or write, but not both things at the same time.
D. None of the above is true.
6. Which of the following statements is correct?
A. The EOF(id) function allows determining how much space is available in a file.
B. The mode must be specified when opening a sequential file.
C. The position must be specified to read a certain piece of data in a sequential access file.
D. The FreeFile() function is used to know if the end of a file has been reached.
Question 1 2 3 4 5 6 7 8 9 10
Answer D B E D C B E A E C

7. Given the following program, what is shown on the screen after running it?
Module Module1 ANSWERS:
Sub Perimeter(ByVal side1 As Double, ByVal A. 8
side2 As Double, ByRef peri As Double)
B. 4
peri = 2 * side1 + 2 * side2 + peri
C. 102
End Sub
Sub Main() D. 12
Dim peri As Double E. None of the above
Perimeter(2, 3, peri)
Perimeter(3, 1, peri)
MsgBox(Peri)
End Sub
End Module
8. Given the following code “Do while m<>5… Loop”. To convert it to “ Do until ….. Loop”. What condition must we put after the “until”?
A. The condition is m=5
B. The condition is m>=5
C. The condition is m<=5
D. The condition is the same, that is, m<>5
E. None of the above
9. Given the following code “Do….Loop while m>5 AND sum=75”. To convert it to “Do ….. Loop until”. What condition must we put after the
“until”?
A. The condition is m=5 OR sum < 75
B. The condition is m>=5 AND sum=75
C. The condition is m<=5 XOR sum <> 75
D. The condition is the same, that is, m>5 AND sum=75
E. None of the above
10. Which of the following statements is correct?
A. A computer’s system bus is composed of: Address Bus, Central Bus and Control Bus
B. The processor may only perform comparison operations.
C. The data required for a program to run, must be in RAM
D. A computer’s system bus is composed of: Data Bus, Control Bus and Direct Bus
E. None of the above

Exercise 1 (1.5 points).- Write the code of a function that receives the following parameters:
• A vector of Integers.
• Two integer values that correspond to positions in the vector and that must be checked to validate that they
are correct.
that returns a String indicating:
• That the position values are incorrect.
• That the vector’s minimum value is found within the two positions.
• That the vector’s minimum value is not within the two positions.

Criteria: Function header (0.25). Declaring local variables (0.15). Checking position values (0.2). Determining the minimum value and its position
(0.5). Determining the response (0.3). Returning the result (0.1)

Exercise 2 (3 points).- A sequential file called “PresTemp” is located on “F” and has values that correspond to:
• Day, month, year and hour of type Byte. For the year, only the last two digits are used.
• Temperature and pressure of type Single.
This file contains data for the first 6 months of the year 2014, with values captured every 3 hours, so the data set is
stored 8 times a day. Write a program code that presents a menu with 3 options:
1.- Asks for a day and a month and shows the average temperature and pressure for that day/month. This
option must be implement in the “Main” code.
2.- Asks for a day, checks that it is valid and loads all the temperature data for that month in a vector with as
many positions as days in that month, multiplied by the number of reading that are taken each day. Once the
vector is loaded with data, use Sub to calculate the maximum, minimum and average temperature for that
month.
3.- Exit, which will show a message indicating that the program is finishing.
Any non-valid option must show an error message and return to the menu. The program may only be
terminated with the exit option (3).

Criteria: Variable and type definitions (0.3). Menu (0.5). Option 1 data request (0.2). Data validation for option 1 (0.3). Rest of option 1 (0.3).
Option 2 data request (0.1). Data validation for option 2 (0.15). Temperature vector redimensioning (0.15). Loading values in the vector (0.25).
Sub header (0.2). Sub code (0.35). Exit message (0.1). Error message (0.1).

Exercise 3 (2.5 points).- Define a structure that allows loading the data stored in the file in the previous exercise for
the months of January and May. Write the code that allows loading the data from the file into the structure. Once
the data is in memory, write the code needed to visualize the highest temperature of the first week of May.

Criteria: Structure definition (0.3). Variable definition (0.3). Definition of the place where the data read from the file will be stored (0.2). Find the
month (0.3). Open the file (0.15). Close the file (0.05). Load the structure (0.6). Show the highest temperature of the first week of May (0.6).

You might also like