Looking for L15.4292 - Data Modelling (2024/2025) test answers and solutions? Browse our comprehensive collection of verified answers for L15.4292 - Data Modelling (2024/2025) at moodle.lisboa.ucp.pt.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
[Average expected time to solve this question: 12 min]Function that, given a range representing a matrix with numeric values, returns the column number containing more even values. Example:
| 9 | 6 | 5 | 1 |
| 1 | 3 | 8 | 2 |
| 7 | 4 | 5 | 1 |
| 2 | 2 | 1 | 3 |
For this example function should return
2 (second column is the one with more even values)[Average expected time to solve this question: 12 min]Create a function that, given a string, returns the distinct (unique)characters in that string.Example:
"AVERAGE" --» "AVERG"
[Average expected time to solve this question: 7 min]a) Create a function that, given a string, returns the same string with first and last letter swapped.Example "cats and dogs" ---»"sats and dogc"
b) Create a Sub to ask the user to enter a string and, using the previous function, shows in a message the string with first and last letter swapped.
[Average expected time to solve this question: 5 min]Justify if the following expressions are correct in VBA. For correct ones show their type and value.
a) 7 \ -2 \ LEN("OLA")
b) 2 * InStr("JULIETA", "LI") \ 2
c) (9 \ 3) * SQR(4)
d) INT(1+SQR(900E-2)^2)
[Average expected time to solve this question: 5 min]Create a Sub to fill sheet1 range "A1:C4" with words created with 3, "A" to "E", random letters.Example: (remember results are random)
| DCC | BCC | BCD |
| CAD | EED | CBB |
| BCB | AEE | CEA |
| BAE | BDA | DDE |
[Average expected time to solve this question: 5 min] Build a table with the value for all the variables (during the execution of the following code) and mark all outputs. Sub
Sub Start()Dim A As String, B As IntegerB = 5A = "REVOLUTION"DoIt B, AMsgBox A & BEnd Sub
Sub DoIt(ByVal X As Integer, ByRef S As String)Dim SA As StringSA = ""Do While X >= 1 If X Mod 2 = 0 Then SA = Mid(S, X, 1) & SA End If X = X - 1LoopS = SAEnd Sub
[Average expected time to solve this question: 5 min]Sub to copy all Column A multiple of 5 values to Column B.Program should stop when the first empty cell is found in Column A
Example:
| A | B | A | B | ||
| 12 | before running the code«------------------------- | 12 | 15 | ||
| 15 | 15 | 20 | |||
| 20 | after running the code-------------------------» | 20 | 5 | ||
| 7 | 7 | ||||
| 5 | 5 | ||||
Qual o output do seguinte programa supondo que é inicialmente chamado o procedimento P?Sub P1(ByRef Y as integer)Y=Y MOD 10end subSub PDim Y as integerY=17call P1(Y)call msgbox(Y)End sub
Qual o output do seguinte programa supondo que é inicialmente chamado o procedimento P?Sub P1( ByRef X as string)X = "CA" & X & "LICA"end subSub Pdim C as stringC = "TO"call P1(C)call msgbox(INSTR(C,"TO"))end sub
Qual o output do seguinte programa supondo que é inicialmente chamado o procedimento P?sub P1(ByVal X as integer, ByRef Y as string)Y = chr(asc(Y)-X)end subsub PDim A as stringA= "D"call P1(2,A)call msgbox(asc(A)-asc("A"))end sub