0% found this document useful (0 votes)
32 views11 pages

Week 3

The document contains questions about structured programming and different structured programming tools like flowcharts and pseudocode. Specifically, it asks the programmer to identify: - The programming paradigm used in a billing program developed using independent modules - Whether a statement about structured programming and spaghetti code is true or false - Which structured programming tool is being used in some code examples and algorithms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views11 pages

Week 3

The document contains questions about structured programming and different structured programming tools like flowcharts and pseudocode. Specifically, it asks the programmer to identify: - The programming paradigm used in a billing program developed using independent modules - Whether a statement about structured programming and spaghetti code is true or false - Which structured programming tool is being used in some code examples and algorithms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Question 1 1 point A programmer developed a billing program for a company, this program was

developed by modules, each module is independent and are related to each other through the main body:
Example of the designed structure:
1. Home
Billing module
3. Payment orders module
Sales and Ordering Module
Inventory module
6. End
The code shows a set of steps that can be read sequentially. Mention what type of
programming paradigm is evident in the development
The structured programming paradigm.
The object-oriented programming paradigm.
The event-driven programming paradigm.
The concurrent programming paradigm.

Question 2 1 point Below is an excerpt that talks about spaghetti programming. According to the
excerpt presented, indicate whether the following statement is true or false: structured programming can be
considered spaghetti programming.
"Spaghetti code" is a pejorative term for computer programs that have a complex and
incomprehensible control flow structure. Its name derives from the fact that this type of code appears to
resemble a plate of spaghetti, i.e., a bunch of intricate, knotted strands. This style of programming is
traditionally associated with basic and old languages, where the flow was controlled by very primitive
control statements such as goto and using line numbers".
Image source: https://goo.gl/74UMVr
True
False

Question 3 1 point A program developed under the structure programming paradigm implies that
its code can be read from start to finish.
True
False

Question 4 1 point The following image shows the diagram of a software required by a customer
based on his requirements. Which of the following approaches can be considered correct?
Image source: https://goo.gl/TVhnya
It is not feasible to use structured programming since the problem is complex.
It is feasible to use structured programming since the complex system can be divided into modules and
programmed by processes or stages.
Structured programming cannot be applied since there are different control structures in the diagram.
It is feasible to use structured programming since the system has no control structures.
Question 5 1 point When implementing structured programming as a paradigm, at what stage
should the programmer explain to the client which tool he/she is considering using to make the system and
why he/she has selected it?
Problem definition.
Justification of the proposal.
Identification of modules and functions.
Establishment of test and acceptance criteria.

Question 6 1 point The following image shows a flow chart with the calculation of hours to be
paid to a worker. If you compare this diagram with a pseudocode of the same situation, which sequence is
correct?

Image source: https://goo.gl/7gW9Vu


The tax is calculated. Then, the calculated tax is subtracted from the total amount of hours per tax rate.
The final amount payable is shown in the variable pn
The input variables (ht, to and ti) are read, the outputs (pn) are displayed and then the calculations of
sb, imp and pn are performed.
The input variables (ht, to and ti) are read, the calculations of sb, imp and pn are performed and then the
outputs (pn) are displayed.
The flowchart cannot be represented as a pseudo-language.

Question 7 1 point In an algorithm you have the following instruction line: If AGE > 18 then
WRITE (You are of age) How would this line be represented in a flowchart?
A rectangle must be used and inside it write the condition AGE > 18.
A diamond must be used and within the box incorporate the condition AGE > 18 then WRITE (You are
of legal age).
A circle must be used and inside it write the condition AGE > 18.
A rhombus should be used and within it consider the condition AGE > 18. Then, with an arrow, it must
be identified if the condition is fulfilled, therefore in a rectangle is placed: WRITE (Is of legal age).

Question 8 1 point The following instructions implemented in software (in this case PHP), allow
you to add two numbers.
$first_exam_note = 10 ;
$second_exam_note = 8 ;
echo $first_exam_note + $second_exam_note ;
Which structured programming tool is being used in the above instructions?
Programming language.
Pseudocode.
Flow chart.
None of the above.

Question 9 1 point Given the following algorithm, identify which structured programming tool is
being used:
Variable actual height
Home
Write "what is your height?"
Read height
If height >= 1.90 then
Write "You are tall".
Or
If height < 1.90 then
Write "You are not tall"
End
Programming language
Pseudocode.
Flowchart
None of the above

Question 10 1 point By comparing the pseudocode and the flowchart in the following image it can
be said that:
Image
source: https://goo.gl/W1REwa
They are equivalent and represent the algorithm of the same problem.
Diagram and pseudocode are not equivalent.
The pseudocode with all primitives must be detailed in a strictly structured manner.
The flowchart is not correct, since the symbology used is not valid.

Question 11 1 point In a flowchart it is not necessary that all the symbols that compose it are
connected.
True
False

Question 12 1 point What error can be identified in the flowchart presented, when compared to its
equivalent pseudocode?Given the pseudo-language:
If condition is "true
Tasks to be performed if the condition is true
If condition is "false
Tasks to be performed if the condition is false

Image source: https://goo.gl/XeFocd


The circle cannot join the two exits of the condition
Arrows have no defined direction
Tasks are not represented in squares
No errors in the diagram

Question 13 1 point A programming team in a company decides to use structured programming to


decrease bug fixing time and decrease software testing times. Did the team make the right decision in
selecting this paradigm?
True
False

Question 14 1 point By comparing the flowchart presented and the respective pseudocode it can
be stated that:
Image source: https://goo.gl/iF1drh
Home
READ (b)
READ (h)
Calculate A = b * h / 2
Writing (A)
End
There are start and end primitives, 3 variable readings (b, h, A) and an assignment primitive A
There are start and end primitives, 2 variable reads (b, h), a variable write primitive (A) and an
assignment primitive (A).
3 inputs and 1 output are shown, with their respective start and stop
A pseudocode of the calculation of the area of a triangle is shown.

Question 15 1 point A company needs to implement a system in all areas of the organization
(sales, inventory, support, budget). It is decided to design a system where each of the areas is programmed
by modules independently from the others, i.e., to break down the whole into parts. For this to be feasible,
what property of structured programming must be considered?
Abstraction
Complexity
Integration
Scalability

Question 16 1 point Look at the following algorithm and then answer which structured
programming tool it represents:
Determine whether the number is positive or negative.
Define variable N: Integer.
Home
Type: Enter the entry number
Read (N)
If N > 0
Write:N is positive
Or
Write: N is negative
End
Programming language
Pseudocode
Flowchart
None of the above

Question 17 1 point Read the following statement and then indicate whether it is true or false: The
flowchart focuses on the developer knowing the context or environment of the program to be designed.
Every system has an environment surrounding it; its environment, therefore, will be a system that receives
inputs and generates outputs.
True
False
Question 18 1 point Look at the following image and then answer: what type of diagram or model
does it correspond to?

Source:
https://goo.gl/C6zLRN
Flow chart.
Context diagram.
Entity-relationship diagram.
Data dictionary.

You might also like