Computer Science Exam Questions Flashcards
(36 cards)
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
A processor contains several special registers
Name and describe three buses used to convey information between the special registers.
Name and describe three buses used to convey information between the special registers.
- Data Bus - transfers data between data store and registers
- Address Bus - transfers the location of the data needed
- Control Bus - Transfers what should be done to the data
Computer software is used in geography lessons to teach students about weather systems.
Describe how the following forms of output will be used by the software
1. Animation
2. Interactive Presentation
Describe how the following forms of output will be used by the software
- Animation - Used to illustrate weather systems which would otherwise not be possible, done through pictures and video
- Interactive Presentation - using inputs from users when answering questions about one stage and if the responsive is correct would move onto the next stage
The office workers of a large company each use a stand-alone computer.
The finance manager needs to work on some files at home and also to assess new software for use in the finance department
State three different storage devices that the finance manager would use and describe what each device would be used for
State three different storage devices that the finance manager would use and describe what each device would be used for
- Separate Hard Disk - transfer files and software from work and his home
- USB Drive - transfer of files from work to home, software to large would need a separate hard disk though
- Virtual Storage Space - Access files available in the department from anywhere without the need for a physical device.
Interactive Care Units in hospitals are for patients in need of round the clock monitoring and support. Computerised systems can be used to monitor patients’ vital signs (temperature, heart rate, blood pressure and breathing). They can then alert medical professionals to any significant changes.
These systems are usually run on an embedded, real-time, operating system.
i. State what is meant by the term real-time
ii. Explain why a real-time operating system would be suitable for Intensive Care Units
i. State what is meant by the term real-time
They have a guaranteed frame rate
ii. Explain why a real-time operating system would be suitable for Intensive Care Units
Stops patients from not receiving treatment in time stop any delays in response
The computers in a car showroom are connected in a network with all data being held on a central server. The computers are used by salesmen, but can also be used by customers to watch videos of the cars that are on offer.
What is meant by a protocol?
What is meant by a protocol?
A protocol is a series of rules followed by computers that govern data transmission
TCP/IP uses packet switching.
Explain what is meant by packet switching.
Explain what is meant by packet switching.
Data is split into packets which are labelled, including the address & order each packet is set on the most convenient/avoidable route meaning they arrive in a different order, and once they all arrive they are re-ordered.
Explain two advantages of using packet switching instead of circuit switching to send a messaage between two computers on a network
Explain two advantages of using packet switching instead of circuit switching to send a messaage between two computers on a network
- safer from interception as it is impossible to intercept all packets de to the many different routes they take
- Very efficient use of network as each channel only used for short time/does not tie up a part of the network
A computer represents floating-point binary numbers using a 6-bit mantissa and a 4-bit exponent, both using two’s complement
Add the following three numbers together and give the answer in the format described. You must show your working
010100 0010
011000 0001
100010 0010
0.5 + 0.125 = 0.625e2 = 0.390625
010100 = 0.625
0010 = e2
0.5 + 0.25 = 0.75e1 = 0.75
011000 = 0.75
0001 = e1
-1 + 0.0625 = -0.9375e2 = 0.87890625
100010 = -0.9375
0010 = e2
0.390625 + 0.75 + 0.87890625 = 2.01953125 = 1.000000101 * 2^1
Below are extracts from the ASCII and EBCDIC character sets.
(https://cdn.discordapp.com/attachments/860926934221062177/971408977420234773/IMG_6222.jpg)
Explain, referring to ASCII and EBCDIC, what would happen if computers were to use different character sets when communicating.
Explain, referring to ASCII and EBCDIC, what would happen if computers were to use different character sets when communicating.
Characters using ASCII would be interpreted as different characters by EBCDIC, and will be incomprehensible