0% found this document useful (0 votes)
43 views2 pages

Structured Programming Quiz IT223

1. The document is a quiz for a programming language structure course. It contains questions testing knowledge of programming terminology, concepts, and syntax. 2. The questions cover topics like the definition of programs and modules, variable types, comparison operators, identifier naming rules, and structured programming phases. 3. Students are asked to identify terms, enumerate concepts, identify valid identifier declarations, and write a program demonstrating variable use, operators, selection statements, and constants.

Uploaded by

Bryan Cabotaje
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)
43 views2 pages

Structured Programming Quiz IT223

1. The document is a quiz for a programming language structure course. It contains questions testing knowledge of programming terminology, concepts, and syntax. 2. The questions cover topics like the definition of programs and modules, variable types, comparison operators, identifier naming rules, and structured programming phases. 3. Students are asked to identify terms, enumerate concepts, identify valid identifier declarations, and write a program demonstrating variable use, operators, selection statements, and constants.

Uploaded by

Bryan Cabotaje
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

Republic of the Philippines

NUEVA ECIJA UNIVERSITY OF SCIENCE AND


TECHNOLOGY

MASTER OF SCIENCE IN INFORMATION TECHNOLOGY


IT223: STRUCTURE OF PROGRAMMING LANGUAGE

QUIZ

I. IDENTIFICATION. Each statement describes a certain terminology. Read and answer


each number. Write your answer on the space provided.

__________________1. is a series or set of accumulated instructions that a machine can follow to


accomplish a specific task.

__________________2. A program design style where a program is broken into smaller independent
units called as modules and each module is developed independent of each other.

__________________3. Data is categorized as _____when its value cannot be changed while a


program is running. 

__________________4. It can come from different sources?


__________________5. Value cannot be changed while a program is running.
__________________6. may contain any combination of letters and digits.
__________________7. Tell the CPU what to do with the data.
__________________8. Are used to define if the values of two expressions are equal or not then the
result is true or false.

__________________9. Sometimes called as comparison operators.


__________________10. Is a type of data that holds fractional values.

II. ENUMERATION. This section ask you to write and enumerate what is being asked.

1-3 Three phases of structured programming


4-5 Ideas of Top-Down Analysis approach
5-6 Two elements of c++ program
7.10Give atleast four (4) requirements as an identifier that you can define in C++.
III. Given the following, encircle the correct declaration of identifiers.

a. Date_of_Birth
b. SubjGrades g. int
c. 2_numbers h. debit#credit
d. cout i. if
e. RATE_PER_HOUR j. double
f. isBooleanYesOrNo

IV. Write any program that will apply the following:

a.) Variable declarations


b.) Shortcut operators
c.) All Selection statements(if/if else/nested if else/switch)
d.) Constants
e.) Increment/Decrement operators

Submit/Send to [Link]@[Link]
with this filename: QUIZ-IT223-Surname_FirstName

“There are no shortcuts to any place worth going.”


-Beverly Sills

Prepared by:
Jet C. Aquino

Common questions

Powered by AI

Structured programming techniques, like those enumerated in Source 1, benefit software development by promoting clear and logical program flow, reducing complexity, and enhancing maintainability. By structuring code into phases or well-defined blocks, these techniques ensure that each segment performs a specific function, facilitating easier comprehension and debugging. They encourage the use of control structures like loops and conditionals rather than goto statements, which minimizes errors and enhances code readability. Adopting such techniques leads to more robust and reliable software that is easier to test, extend, and document .

In programming, data types used to hold fractional values primarily include 'float', 'double', and 'long double', each differing in precision and memory usage. 'Float' typically offers 32-bit precision, whereas 'double' provides 64-bit, allowing for more accurate representation of decimal numbers. 'Long double' further extends precision for applications requiring a high degree of numerical accuracy, but at the cost of more memory. These distinctions are crucial for applications in scientific computing and graphics processing, where precision can significantly affect outputs. Selecting the appropriate type balances the trade-off between accuracy and resource consumption .

Breaking a program into smaller independent units, or modules, is significant because it enhances code maintainability, readability, and reusability. Modular programming allows developers to isolate different functionalities within separate modules, which can be developed, tested, and debugged independently. This separation reduces the complexity of managing the application as a whole and facilitates collaboration among developers who can work on different modules simultaneously without conflict. Furthermore, well-defined interfaces between modules enable easy integration and allow reused of existing modules across multiple projects .

Immutability in data types, where values cannot change during program execution, is important for several reasons. First, it aids in maintaining data integrity and consistency throughout the runtime of a program, reducing the risk of accidental changes. Immutable data structures are inherently thread-safe, avoiding concurrency issues without the need for synchronization mechanisms, which simplifies parallel processing. Additionally, immutability can lead to more predictable and manageable code, as functions operating on immutable data produce no side effects, facilitating easier debugging and testing .

Selection statements enhance control and flow in programming by allowing developers to execute different blocks of code based on evaluated conditions, making programs responsive and adaptive to varying inputs. Examples include 'if', 'if else', 'nested if else', and 'switch' statements, each providing various levels of conditional execution options. An 'if' statement executes code if a condition is true, 'if else' provides an alternative path if the condition is false, 'nested if else' allows for more complex conditions, and 'switch' handles multiple possible cases with greater efficiency and clarity than repeated 'if else' checks .

Constants in programming are essential as they define values that cannot change throughout the program execution, crucial for ensuring consistency and preventing unintended alterations. They are particularly beneficial for representing fixed values, such as mathematical constants, configuration parameters, or any value that needs to remain stable, thereby improving code reliability and readability. Using constants also helps to prevent 'magic numbers' in code, leading to more maintainable and understandable codebases. Moreover, since their values are immutable, they provide optimization opportunities for compilers and enhance security by reducing vulnerabilities to data manipulation .

The top-down analysis in software development offers several benefits, such as providing a clear hierarchical view of the system, which helps in planning and managing large projects. By breaking down problems into smaller, more manageable components, this approach facilitates understanding of complex systems, allows prioritization of development tasks, and streamlines debugging by isolating issues within smaller units. However, it also presents challenges, like the potential for overlooking low-level implementation details early in the design phase, which may result in necessary rework or adjustments. Also, it may become rigid if changes in system requirements occur, necessitating significant redesign .

Identifiers in C++ are crucial as they serve as the names for variables, functions, and other entities, making code understandable and maintainable. Good programming practice involves using descriptive and meaningful identifiers, which helps convey the purpose or use of the data or function they represent. Key requirements for defining identifiers in C++ include starting with a letter or underscore, being composed of letters, digits, and underscores, and avoiding reserved C++ keywords. Proper naming conventions enhance code readability and prevent errors, contributing to more maintainable and error-free software development .

Comparison operators play a fundamental role in programming by allowing conditions to be expressed, which are critical for decision-making in control flow. They evaluate relationships between two values or expressions, returning a boolean true or false, which serves as the basis for conditional logic. These operators enable determination of equivalence or order, and their results can control the execution of code blocks in statements such as 'if', 'while', and 'for'. For instance, testing if a number is greater than another can determine whether to enter a specific section of code, enabling versatile and dynamic program behavior .

Shortcut operators in programming, such as '++', '--', '+=', and '*=', streamline code by combining operation and assignment into a single statement, reducing redundancy and improving code efficiency. These operators help in performing operations directly on variables, which makes the code more concise and potentially faster because it minimizes repetitive syntax. For instance, 'x++' increments a variable by one, while 'x += y' adds the value of 'y' to 'x', updating 'x' directly and succinctly. Such operations are commonly used in loops and iterative constructs where frequent updates to variables are necessary .

You might also like