1 FINAL EXAM SCRIPT 2026 COMPLETE
QUESTIONS AND ANSWERS GRADED A+
◉Why are local varaibles useful. Answer: it ensures that each
subroutine is completely self contained and independent of any
global variables
◉why is data hiding and encapsulation important. Answer: a
subroutine written using these princibles can be tested
independently
◉What are the advantages of using a subroutine in a large program.
Answer: a subroutine is small enough to be understandble so its
easy to debug and maintain. They can be tested indipendently
therefore shortening the time taken to get a large program working.
◉why does data need to be stored in a file or a disk. Answer: if you
want to store the data permanently so that you can read or update it
in the future
◉What does a file consist of. Answer: a number of records
,◉what does a record consist of. Answer: a number of fields each
holding one item of data
◉what are the 3 different types of modes in which you can open a
file. Answer: red write and append
◉What are the stages in software development. Answer: Analysis,
Design, Implementation, Testing, Evaluation
◉What is analysis. Answer: The requirements and goals of the
project are established and alternative solutions are suggested. The
need of the end user is also considered
◉What is the design. Answer: where data strcutures, algorthims
user interfaces and screens are designed
◉What is implementation. Answer: the process of coding
◉what is testing. Answer: where the whole system is tested for
errors
◉what is the evaluation. Answer: where the system is evalutted
accoding to given criteria
, ◉What are the different types of strategies in problem solving.
Answer: exhaustive search and divide and conquer
◉What are the steps for binary search. Answer: 1 - look at the
middle item of the first list if that item is being sought stop searching
2 - otherwise if the middle item is greater then the one being sought
the item you are looking for must be in the first half of the list so you
can discard the second half
3 - repeat the process with the new list until the item is found
◉what does the structured approach of programming aim to
improve. Answer: the clarity and maintainability of programs
◉What are the 3 techniques used in structured programming.
Answer: sequence selection and iteration
◉what does a block structured language allow. Answer: it allows the
use of just three types of control structure
◉why is it important for clarity to not use global variables in a
subroutine. Answer: global variables will make it more difficult for
the code to read and follow