Computer Science Exam Questions Flashcards
Describe what happens during Syntax analysis, when code is compiled
- The given input is checked for the confirmation of rules and structure of the formal grammar
- It analyses the syntactical structure and checks if the given input is in the correct syntax of the programming language or not
- If an error is found, A syntax error is reported
A high-level language states what is required but not how to do it. The statements do not have to be in a specific order.
Identify the type of language described
State one typical use for this type of language and give one reason for your choice
Identify the type of language described
Declarative
State one typical use for this type of language and give one reason for your choice
Medical diagnosis/expert systems - Reason
A potential reason could be for a medical diagnosis is that it is just reporting on what the symptoms are, not how to solve them
Low-level languages have features which include opcodes and mnemonics
Explain the term opcode
Explain the term mnemonics, giving an example
Explain the term opcode
The opcode is the instruction that is executed by the CPU
Explain the term mnemonics, giving an example
mnemonics are pieces of code to help humans understand what binary instructions represent, so instead of outputting the binary for instruction, let’s say load, it would instead output LDA
A professional photographer, Sarah, takes and edits photographs for magazines
Sarah carries around a digital camera and laptop to use on shoots. She keeps extra peripherals in her office that she can use when editing and finalising photographs.
The laptop has both system software and application software
Define the term ‘software’.
Explain why Sarah needs both system and application software
Sarah needs a computerised system in which to catalogue her photographs.
Give two reasons why you would not recommend that Sarah has this software custom written
Define the term ‘software’.
Software is any program or operating system inside of a computer
Explain why Sarah needs both system and application software
Needs software for both systems and applications because the software instructs them how to run
Give two reasons why you would not recommend that Sarah has this software custom written
- Expensive
- Easy to get off the internet
A software development team is writing a word game
The team is using Rapid application development
Describe the Rapid Application Process
Describe the Rapid Application Process
• Form of agile software
• Prioritizes releases and iterations
• Emphasizes the use of software and user feedback over strict planning and requirements recording
• starts with analysis and quick design, then goes through a loop of building, demonstrating and retrieving data, once it has been satisfactorily built, it is put into testing and implementation
Open-source software has grown in popularity over the last few decades
State the name of a type of translator software other than a compiler or interpreter
State the name of a type of translator software other than a compiler or interpreter
Assembler
A software company decides to release a duplicate file finder which it has named “De-Duplicator, Duplicate files are files that are the same (bit for bit identical). Space s often wasted on computers by having multiple versions of the same file. Duplicate file finders are programs that find and identify duplicate files on a hard drive so that they can be removed.
The software team that produces De-Duplicator decides to make a new version that can detect duplicated images that the previous version could not. The software team must decide which methodology they will use for the project. Some members of the team suggest extreme programming whilst others would prefer to use the waterfall lifecycle
Discuss the two methodologies and justify which you would recommend
Discuss the two methodologies and justify which you would recommend
Advantages of waterfall lifecycle
• Allows for strict schedules to be made for different parts of the program to be made, allows the programmers to know how close they are to completion
• Easy to manage due to the rigidity of the model
• Easy to arrange tasks
• Cleary defined stages
Disadvantages of waterfall lifecycle
• No working prototype is made until late into the cycle
• Not good for complex problems or object-orientated problems
• Not good for a changing target
• Integration is done as the final step, so any technological or business bottlenecks can’t be identified until it is finished
Advantages of extreme programming
• Saves companies cost and time
• reduces risks regarding programming or project failure through pair programming
• starts with simple code that works and gets improved upon at any time
• Constant feedback can be given, as integration can happen early on
Disadvantages of Extreme programming • Customers must participate in the process since their feedback is constantly needed • Can be a large time investment • Can be expensive • Requires version management
Liquid Lizards is a computer game in which players get to fire lizards from a cannon to knock down walls. Players get to pick different types of lizards, each with qualities and special powers
The game is coded using an object-oriented language. Below is the code for the lizard class
(https://cdn.discordapp.com/attachments/860926934221062177/971376741551595550/IMG_6218.jpg)
This game uses a 2D graphics library. Explain why a linker would need to be used after compilation
This game uses a 2D graphics library. Explain why a linker would need to be used after compilation
• To like the 2D graphics library to the code a linker is needed
• without the code the 2D graphics library would not know what to do
• 2D graphics library would not need to be installed if a linker is present
The program, as shown in Fig.2 below, is written in assembly code using the Little Man Computer instruction set. It is supposed to take in two numbers and output the higher
(https://cdn.discordapp.com/attachments/860926934221062177/971377830086709298/IMG_6219.jpg)
State what type of translator program would be needed to convert the code above into machine code.
State what type of translator program would be needed to convert the code above into machine code.
Assembler
A gaming company decides to release a new video games console. The console will use a modified version of an operating system called Linux
Linux is open-source
Explain how Linux being open-source would benefit the games company
Explain how Linux being open-source would benefit the games company
• allow for already existing code to make games cheaper
• don’t need to pay for propriety operating systems
• Company just needs to make adjustments
The following is a program written using the Little Man Computer instruction set.
(https://cdn.discordapp.com/attachments/860926934221062177/971378915203506226/IMG_6220.jpg)
Identify the type of memory addressing the program uses.
Describe the difference between the STA and LDA instructions
Identify the type of memory addressing the program uses
Direct Addressing
Describe the difference between the STA and LDA instructions
LDA is used to load data from specific locations
STA is used to store data currently in the accumulator
A software development company is building an operating system for a mobile phone that is in the process of being designed.
The developers follow the waterfall Cycle.
List three stages of the waterfall Cycle
Justify why the waterfall lifecycle is suited to the development of the operating system
Give one disadvantage to using the waterfall lifecycle to develop the operating system
List three stages of the waterfall Cycle
- Requirements
- Design
- Implementation
Justify why the waterfall lifecycle is suited to the development of the operating system
• Suits large scale projects, like an Operating System
• Suits projects which have requirements which are unlikely to change, Operating systems requirements are unlikely to change
Give one disadvantage to using the waterfall lifecycle to develop the operating system
• Lifecycle process cannot adapt to change
State three benefits of using library routines when a program is written
State three benefits of using library routines when a program is written
- Can be called from other programs
- Makes writing programs faster
- May already be debugged
Place ticks in the table to show which statements apply to the modes of addressing shown for a low-level instruction in the form ADD123.
Caz is studying low-level languages. She has lost some of her notes on modes of address but has the following part of an example
Address in Current Instruction Register (CIR) is 3
Address to be used is 3+11 = 14
Name and explain two modes of addressing that this example could show
Place ticks in the table to show which statements apply to the modes of addressing shown for a low-level instruction in the form ADD123.
(https://cdn.discordapp.com/attachments/860926934221062177/971381243780431912/IMG_6221.jpg)
Name and explain two modes of addressing that this example could show
Relative addressing uses offset 3 to calculate the read address from the base address
Indexed addressing modifies address 3 by adding number 11 from index register
Second Paper