0% found this document useful (0 votes)
3 views6 pages

Computer Programming Assessment Results

Eliane Yoko Tomita completed an online assessment in computer programming, answering 9 out of 10 questions correctly for a score of 27.00 points. The assessment covered topics such as algorithms, conditional structures, and C programming. The document includes specific questions and answers related to programming concepts and algorithms.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

Computer Programming Assessment Results

Eliane Yoko Tomita completed an online assessment in computer programming, answering 9 out of 10 questions correctly for a score of 27.00 points. The assessment covered topics such as algorithms, conditional structures, and C programming. The document includes specific questions and answers related to programming concepts and algorithms.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

LEGEND

Online Assessment (EAD ROOM) Correct answer to the question

ELIANE YOKO TOMITA Activity completed on 09/13/2021 20:57:49 (attempt: 1) # Correct answer - Question Annulled

X Response selected by the Student

Discipline:
ALGORITMO E PROGRAMAÇÃO DE COMPUTADORES [capítulos - 4,5,6] - Avaliação com10questões, com o peso total de30,00pontos

Class:
Second Degree: Training for Second Baccalaureate in Physics - Group: JUNE/2021 - FDLICFIS/JUN21 [22755]

Student:
91210818 - ELIANE YOKO TOMITA - Respondeu9questões corretas, obtendo um total de27,00pontos como nota

Consider a vector with N elements that contains random numbers. Consider


Question also a sequential search algorithm, which examines the first element of this
001
vector and follows sequentially, examining element by element until finding the
desired or even reach the end of the vector.
If the sought element is the last one, the algorithm may not find it, because until
reaching its position in the vector, the search information has already been lost in memory.
The described scenario presents the operating principle of one of the algorithms.
X
simpler for search, the sequential search algorithm.
The described scenario does not represent a description of a search algorithm.
If the sought element is the first one, the described algorithm may enter a loop.
because it is programmed to traverse all the positions of the input vector.
The search algorithm described is very efficient and will always easily find
quickly the sought element, regardless of the size of the vector of
entry with the elements.

Evaluate the following statements and mark the correct alternative.


I - The IF command is the simplest conditional structure that exists and is present
in virtually all programming languages.
Question
002 II - The purpose of a selection structure (or conditional structure) is to decide whether
a part of the code will execute or not.
III - When we have more than one IF inside another, we have the condition of if.
chained, or nested if.
Only I is correct.
Only I and III are correct.
Appendices I and II are correct
Only II is correct
X All alternatives are correct.

Atomic Brush - 11/11/2021 21:44:11 1/6


Analyze the C program below and mark the CORRECT alternative regarding
its functionality.
#include<stdio.h>
#include<conio.h>
int main()
{
int values[5][5], i, j;
for (i=0;i<5;i++)
{
for (j=0;j<5;j++)
Question {
003
values[i][j] = (i+1)*(j+1);
}
}
for (i=0;i<5;i++)
{
for (j=i;j<5;j++)
{
values[i][j] = 0;
}
}
}
This program declares a square matrix of order 5 and two auxiliary variables.
for loop. It initializes the values of the matrix using operations with
X the values of the auxiliary variables themselves in the loops and after initialization
transform the matrix into a pseudo lower triangular matrix, placing 0 (zero) in
its main diagonal and all the elements above it.
This program works with two matrices to insert values based on
use of i and j within the program in order to maximize the exploration of the
optimization of the use of matrices with loops, as this is the objective
to be able to use such structure.
This program does absolutely nothing, as there is an error that prevents its execution.
execution.
This program inserts values into the matrix and then zeros all the inserted values.
For this, the program uses two loops and two auxiliary variables, i and j.
This program declares a 5x5 matrix and two auxiliary variables to
loop. It initializes the matrix values using the variables i and j of
links and after initialization transforms the matrix into an upper triangular matrix,
placing 0 (zero) in all elements below the main diagonal.

Atomic Brush - 11/11/2021 21:44:11 2/6


According to the algorithm below, analyze the alternatives from I to IV:

#include<stdio.h>
#include<conio.h>
int i, grade;
int main()
{
for ( i=1 ; i<=10 ; i=i+1)
{
printf("\nEnter the grade: "); scanf("%d", &grade);
if (grade < 60)
{ printf("\nStudent FAILED"); }
else
Question
004 Student APPROVED
}
getch();
}

I. This algorithm reads the grades of 10 students, indicating for each grade whether the student is
approved or disapproved.
II. This algorithm will not compile and run correctly because it presents some kind of
error.
III. The main mistake made by this algorithm is the definition of a structure
conditional within a loop structure.
IV. If all students have passed the test conducted in the structure
conditional will always be evaluated as FALSE.

Only the following items are CORRECT:


III and IV.
All items are correct.
II.
II and III.
X I and IV.

Question
005 Arrays are also called
Functions or Procedures
Selection Structures.
Repetition Structures
X Vectors or Matrices
Set of diverse types

Atomic Brush - 11/11/2021 21:44:11 3/6


Analyze the algorithm below that aims to read two values regarding the Base and
Height of a geometric figure and present the area of this figure.

#include<stdio.h>
#include<conio.h>
int altura,largura,area;
int main()
{
printf("Enter the Height: "); scanf("A", &height);
printf("Enter the Width: "); scanf("%d", &width);
area = altura * largura;
Question if (B)
006
{
The area of the rectangle is: %d
}
C
{
The area of the square is: %d
}
getch();
}

The sequence of options that can CORRECTLY replace the markings A, B


This algorithm is respectively:
%f - rectangle - if (square)
height = width - if (square)
X %d - height != width - else
height - height == width - if (width)
%d - height < width - else

Read the statements below and mark the CORRECT option.

I. When the return command is associated with a value, this value must be of
the same type as the function declaration and will be returned to the calling process
Question
007 function.
II. Global variables are defined this way because they have global visibility, so they can
to be used anywhere within the global program they are part of.
III. In the C language, variables can only be declared at the beginning of
blocks, that is, after the opening of the braces {
Only III is true
X Only I and II are true
Only II and III are true
Only I and III are true
All the alternatives are true

Atomic Brush - 11/11/2021 21:44:11 4/6


Read the statements below and mark the CORRECT alternative.
I. O condicional ternário ((condição)? Valor se verdadeiro: valor se falso) é uma
conditional structure that can be used to replace the IF conditional in
any situation in which the IF is applied.
II. The switch-case is a conditional structure that can be used in various
conditional situations, but it has some usage restrictions, such as
Question limitation of the type of data used in the structure.
008
III. A conditional structure can be simple or compound. When simple, it
check only one condition without worrying about the contrary cases, already the
composed conditional structure always generates a check for the opposite case to
from the established condition, with an exclusion behavior for the others.
IV. Conditional structures can be used as many times as necessary.
within a program, but we cannot have several conditions one inside the
another, as this may create conflict with the way the else command functions.
Only IV is correct.
X Only II and III are correct.
Only III and IV are correct.
Only I and II are correct.
All alternatives are correct.

Enade Computer Science (2017) - The following algorithm works with an array
global vector of integers and rearranges this vector so that its elements,
in the end, they should be sorted in ascending order. Note that n is a global variable
what determines the size of the vector.

Question
009

Considering that there are logical errors in this algorithm that need to be corrected to
that the elements be arranged in ascending order, mark the correct option in
that refers to the appropriate corrections.
Line 04 should be corrected as follows: for ( i = 1; i < n - 1; i++) and line 07,
in the following way: j = i + 1;

Atomic Brush - 11/11/2021 21:44:11 5/6


Line 10 should be corrected as follows: v[j + 1] = v[j]; and line 13, of
next way: v [ j – 1 ] = key; .
Line 07 should be corrected as follows: j = i + 1 and line 08, as follows
mode: while (j >= 0 && v[j] > key).

X
Line 08 should be corrected as follows: while ( j >= 0 && v [ j ] > key) and the
line 10, as follows: v[j + 1] = v[j];.
Line 04 should be corrected as follows: for (i = 1; i < n - 1; i++) and line 13,
in the following way: v[j - 1] = key;

Question
010 Mark the correct alternative
The input and output tasks in an algorithm are complementary tasks of
should always be carried out together
Reserved words are some words of a programming language.
what we need to book before its use
The order of precedence of the operators determines the order in which we should use them.
the same, unable to use one before the other that has greater precedence
To assign a value to a variable, we must use the logic operator.
assigned relational

X
Syntax is a term used in algorithms and programming to describe the form
basic instruction or command

Atomic Brush - 11/11/2021 21:44:11 6/6

You might also like