Questionnaire
1.- Write a definition of algorithm.
R= It is a set of steps, procedures, or actions that allow us to achieve a result or
solve a problem.
2.- Write the characteristics of an algorithm.
An algorithm must be Precise, Defined, Finite, and must also follow a sequence of
Clear and finite instructions, it must be correct and must solve the problem presented in all its
facets and being legible.
3.- What does it mean for an algorithm to be precise?
R= Indicate the order of execution for each step.
4.- What does it mean for an algorithm to be defined?
That if an algorithm is followed twice, the same result should be obtained.
5.- What does it mean for an algorithm to be finite?
R= That an algorithm must terminate at some point.
6.- What are the phases for solving a computable problem?
R= • Program design: -Problem analysis and -Algorithm design
•En la computadora: -Codificación del algoritmo, -Ejecución y Verificación del programa y –
Maintenance (documentation).
7.- What are the phases of problem analysis?
R= Define and understand the problem, Identify the input data and Identify the output data or
the result.
8.- What are the phases of design and verification of an algorithm?
R= Top-down design, Stepwise refinement, and The programming tools that are:
Flowcharts and Pseudocode.
9.- Escribe 10 ejemplos de problemas computables.
Area of a triangle, a square, a circle, the perimeter of a rectangle, the
multiplication and addition of numbers, store names, phones, addresses, and grades.
10.- Escribe 10 ejemplos de problemas no computables.
R=economic and material loan, heal diseases, purchase of objects, compose a material,
prepare food by herself, fix a gas leak, catch a criminal, extinguish a fire and
change a car tire.
11.- Write some characteristics of a computable problem.
R= Thesetof computable functions iscountable.
Given computable functions f and g, then f+g, fg, and fog are computable functions.
Computable functions are arithmetically definable.
A boolean-valued function f is a computable predicate if and only if the language isrecursive.
12.- Write some characteristics of a non-computable problem.
R= Non-computable problems cannot be solved by means of an algorithm or
pseudocode.
13.- Write some methods to solve computable problems.
Software life cycle.
R= A software life cycle model is a view of the activities that occur
during software development, try to determine the order of the stages involved and the
transition criteria associated between these stages.
Structured design.
R= Aims to develop algorithms that meet the property ofmodularity, for this, given
a problem that is intended to be solved through the development of acomputer program
look to divide said program intomodulesfollowing the design principles of Decomposition by
successive refinements, creation of a modular hierarchy and development of modules
Independents.
Object-oriented design.
R = It is the discipline that defines the objects and their interactions to solve a problem of
business that was identified and documented during the object-oriented analysis.
Modular design.
The modular design consists of dividing the main problem into subproblems, each one
of them focusing on a specific task of the problem. To apply Modular design, there are 2
Criteria: a) By Functional criteria and b) Object-Oriented (O.O.)
14.- When solving a computable problem, what activities are carried out without
consider the use of the computer?
R= The development of the algorithm, the pseudocode, etc.
15.- Mention some activities in the design stage.
Approval of the project and operational planning
16.- Mention some activities in the analysis stage.
To properly define a problem, it is advisable to answer the questions: What amount and
What type of input data is required? What amount and type of outputs are desired? What method(s)?
does it produce the desired output?
17.- When solving a computable problem, what activities are carried out using
from the computer?
R= The development of the flowchart and the code to execute the problem.
18.- What does coding consist of?
R= The algorithm is translated into an appropriate programming language.
19.- What does the execution consist of?
The compilation process involves converting the source code into a code
executable. The execution is to 'run' the program generated in the compilation process.
20.- What does the verification consist of?
It is to check that the program is free of errors.
21.- What does maintenance consist of?
R= The process of improvement and optimization of the software after its delivery to the end user (is
say; program review), as well as correction and prevention of defects.
22.- What does the documentation consist of?
R= Interna: Comentarios dentro del programa. Externa: Manuales del programador, del usuario, de
installation, etc.
23.- Write the steps of the problem analysis.
R= Define and understand the problem, Identify the input data and Identify the output data or
the result.
24.- What does the phase of defining and understanding the problem consist of?
It is to expose clearly and accurately the characteristics and understand what the problem is about.
25.- What problems could occur when proposing a solution to a problem that has not been addressed?
understood well and that a precise definition has not been reached?
R= The algorithm's resolution would be incorrect
26.- What does it mean to identify the input data?
R= It consists of the initial data that the algorithm has before it executes.
27.- What are variables?
R= Sondata structuresthat have a known value and can change content to
length of the execution of aprogram.
28.- What are constants?
R= They are permanent type values that cannot be modified, at least not within the context.
or situation for which it is intended. It is usually related to and used in combination with the variables.
29.- What are integer data?
R = Set of positive and negative integers
30.- What are character type data?
R= Set of elements from a predefined character set or alphabet (normally it
use the ASCII character set
40.- What are floating-point or real data types?
They are divided into two sizes: float 4 bytes and double, which are 8 bytes. They can be used both
to represent decimal numbers, just as to represent integers with an order of
very large magnitude.
The way to declare a floating variable is by writing one of the data types in a line.
floating and then the name of the variable and maybe some value that one wants to give them.
Some examples:
float a;
double a = 1e23;
double a = 3.1416;
float a = 4e-9;
double a = -78;
41.- What is an array?
Arrays are a collection of variables of the same type that are referenced using a name.
common. An array consists of contiguous memory positions. The lowest address corresponds to the
first element and the highest at the last. An array can have one or multiple dimensions. For
to access a particular element of an array, an index is used
42.- What is a record or structure?
Incomputer scienceand specifically in the context of arelational database, a record (also
called a row or tuple) represents aitemunique fromdataimplicitly structured in atable. In
In simple terms, a database table can be imagined as made up of rows and columns or
fieldsEach row of a table represents a set of related data, and all the rows of the
the same table has the same structure.
A register is a set offieldswhat the data that belong to the same contain
repetition of entity. A consecutive number (record number) is automatically assigned.
which is sometimes used as an index although the normal and practical thing is to assign each record a
key field for your search
43.- Write 10 pieces of data that you would store in an integer variable
-2147483648, 1, 4, 123, -2, 4783, 420, -109, 34 ,2147483647
44.- Escribe 10 datos que almacenarías en una variable real o flotante
3.141596, 7.90, 2.34, 4:35, -4.9, 2.7186, Exponenciales 3é43, 34.09, 90.34
45.- Write 10 pieces of data that you would store in a character type variable
A, b, c, d, e, f, g, h, i, j
Nombre
Programación,objeto,proyecto,clase,programa,resultado,objetivo,implementación,proceso,
47.- Escribe 10 datos que almacenarías en un arreglo.
X [ 2,1 ] X [ 5,9 ] X [ 6,1 ] X [ 2,9 ] X [ 7,1 ] X [ 7 ] X [ 9 ] X [ 17 ]
48.- Escribe 10 datos que almacenarías en registros o estructuras.
typedef struct TipoNodo
{
int data;
struct TipoNodo *next;
struct TipoNodo *prev;
} TNodo;
49.- Write 10 pieces of data that you would store in a structure array
. Collection cd[100]; cap
Preciocar [105000];
50.- Write the rules for assigning an identifier to variables.
All identifiers must begin with a letter, the underscore character ( _ ) or the character
dollar ( $ ).
Can include, but cannot start with a number
You cannot include the whitespace character
Distinguish between uppercase and lowercase letters
Reserved words cannot be used as identifiers.
51.- Write the elements that make up an algorithm.
Reserved words such as: start, end, if-then, etc.
Identifiers (variable names)
Special characters such as: commas, apostrophes, quotes, etc.
52.- What are input data?
The initial data that the algorithm has before executing
53.- What is the process stage?
Actions carried out by the algorithm.
54.- What are output data?
Data that the algorithm finally obtains.
55.- What is the strategy for solving a complex problem?
Recognize the problem or the opportunity for change
Accept the ownership of the problem
Understand the problem
Find possible solutions and choose the best one.
Implement the chosen solution
Supervise and evaluate the solution
56.- What does the divide and conquer process consist of?
First, the problem must be framed in such a way that it can be
decomposed into k subproblems of the same type, but of smaller size. It is
to say, if the size of the input is n, we must manage to divide the problem into
k subproblems (where 1 ≤ k ≤ n), each with an input size of nk
where 0 ≤ nk < n. This task is known as division.
Secondly, all must be resolved independently.
subproblems, either directly if they are elementary or recursively.
The fact that the size of the subproblems is strictly smaller than the
the original size of the problem guarantees convergence towards the cases
elementary, also called base cases.
3. Finally, combine the solutions obtained in the previous step to build
the solution to the original problem.
57.- What is the technical name of the divide and conquer process?
58.- Explain step by step the technique of Top-Down Design and refinement for the problem of
calculation of the area of a triangle and finally write those steps with a diagram.
59. - Write the programming tools used to display algorithms.
Analysis of the problem
Algorithm design
Manual verification of
algorithm
On the computer
- Algorithm coding
Execution of the program
Program verification
Maintenance
documentation
Analysis
• Design (descending,
step-by-step refinement
Coding
Execution
Test
Maintenance
60.- What is pseudocode?
It is a language for specifying algorithms. The use of such a language makes the coding step easier.
final (that is, the translation into a programming language) relatively easy.
61.- What is the flowchart?
A flowchart is based on the use of various symbols to represent operations.
specific. They are called that because the symbols used are connected by arrows to
indicate the sequence of operation.
62.- Write some words used in pseudocode.
Ask, read, yes, print
63.- Escribe un ejemplo de pseudocódigo y explica el significado de cada línea del pseudocódigo.
Program that displays the multiplication table of the number entered via keyboard
Program: Times table
Module: main
Variables:
integer
integer
Start
Enter a number
Read number
From t=1 to t=10 repeat
Visualize num, " X", t, "=", num*t
End from
End
64.- How is each step of the algorithm represented in its representation with a flowchart?
65.- In flowcharts, how is the order in which the steps are executed indicated?
Flow direction or connection line. Connect the symbols indicating the order in which they should be
perform the various operations
66.- What standards do the symbols used in flowcharts show?
Flowcharts are generally drawn using some standard symbols; however,
Some special symbols can also be developed when required. Some
standard symbols, which are frequently required for diagrammingprogramsofcomputer
are shown below:
Note: To achieve the correct creation of symbols, there are templates. You can find them.
find in stationery stores.
The flowchart has the following characteristics and advantages:
It is a graphic representation of the sequences of aprocesspresents clear information
organized and concise.
It allows visualizing the frequencies and relationships between the indicated stages.
Problems, disconnections, and scarce steps can be [Link] etc.
Compare and contrast the current process flow against the ideal flow to identify opportunities for
improvement.
Identify the places and positions where additional data can be collected.
investigated.
Help to understand the complete process.
It allows for a quick and pleasant understanding of theprocesses.
67.- Write the main symbols of flowcharts.
68.- Write and explain the 'Terminal' symbol
Terminal. It indicates the beginning or end of the flow, it can be an action or a place; it is also used for
indicate an administrative unit or person that receives or provides information.
69.- Write and explain the symbol 'Input/Output'
Indicates the beginning or end of the flow, it can be an action or place; it is also used to indicate a
administrative unit or person who receives or provides information.
70.- Write and explain the symbol 'Process'
It represents the execution of an operation or activity related to a procedure.
71.- Write and explain the symbol 'Connector'
It represents a connection or link from one part of the flowchart to another distant part.
same.
72.- Write and explain the symbol 'Flow Indicator or Direction'.
Connect the symbols indicating the order in which the different operations should be performed.
73.- Write and explain the symbol 'Dedication'
Decision or alternative. Indicate a point within the flow where several paths are possible.
alternatives
74.- Write a flowchart, briefly explaining each instruction next to the diagram.
75.- Write a flowchart that uses the decision symbol, briefly explaining each.
instruction next to the diagram.
Exercises:
1.- Given the following variables and constants:
Given the following variables and constants:
1 4 10 3.141592 2.718281
X Y Z PI E
Evaluate the expressions:
a.- Data = 2 * x + 0.5 * y - 1 / 5 * z
Data = 2 * (1) + 0.5 * (4) - 1/5 * (10)
=2 + 2 - 2
=2
b. - val = PI * x 8 2 * PI * X – z
Val= (2.718281) * (1) 8 2 * (2.718281) * (1) - (10)
= 2,718281 * 2,718281 – 10
-2.610943901
c.- num=E 8 (x-1) / (x * z) / (x / z)
num= (2.718281) 8 (1 - 1) / (1 * 10) / (1 / 10)
= 1 / 10 / 0.1
=1
2.- Build correct expressions for the following formulas:
A.- F = (9/5 * C) + 32
B.- f= (1 + ((x ۸ 2) / y)) / ((x ۸ 3)/(1 + y))
C.-(1 + ((2.718281 ۸ x) / (x ۸ 2)) ۸ 2) ۸ 2
3.- Calculate the mass of air in a car tire using the formula: PV=0.73m (T+460,
where:
P = pressure, pounds per square inch (psi)
V = volume, cubic feet
m = air mass, pounds
temperature, degrees Fahrenheit
The tire contains two cubic feet of air. Suppose the pressure is 32 psi.
ambient temperature.
P=32
V=2
T = temperature, let's assume it is hot 212°F
M= (32 * 2) (212 + 416)
=62+ 628
=690