Paper 2 Flashcards
High level advantage
- HIGH-LEVEL
- Like written English
- More readable
- Portable-can run on many CPUs
- Slower to execute
Translator
It translates a high-level language program into a machine language program that the (CPU) can understand. It also detects errors in the program
Compliers
High-level Machine code
-The whole program is validated so there are no system errors.
-The executable file is enhanced by the compiler, so it runs faster.
-User do not have to run the program on the same machine it was created.
interpreter
adavantages
advantages
-You discover errors before you complete the program, so you learn from your mistakes.
-Program can be run before it is completed so you get partial results immediately.
-You can work on small parts of the program and link them later into a whole program.
Interpreter disadvantages
disadvantages
Interpreted code runs slower than compiled code. the interpreter has to analyse and convert each line of source code into machine code before it can be executed.
-There’s a possibility of syntax errors on unverified scripts.
-Program is not enhanced and may encounter data errors.
-It may be slow because of the interpretation in every execution.
truth table purpose
- To show all possible inputs (to the logic circuit)…
*and the associated/dependent output (for each
input)
Give two ways that the maintainability of this program could be improved
-Use loop / iteration
-Add comments
-sequence
advantages of sub programs
Easier to maintain
…as code is easier to understand/read
…as code is shorter
Avoid repetition of code (in the same program)
…makes program shorter / smaller
… subprogram called instead of copying/pasting.
… quicker to develop (new) programs
tools that the IDE provides
Editor
* to enable program code to be entered/edited
Translator / compiler / interpreter
* to convert the high level code into machine code /
* low level code / binary
Error diagnostics / debugging
* to display information about errors (syntax / runtime) / location of errors
* suggest solution.
Benefits of translating code from one language to another
Easier to Update: The new code is easier to update and expand. This means you can keep it fresh and up-to-date.
Saves Time: Changes can be made faster. This means you can get things done quicker.
Cost-Effective: Reduces costs. This means you save money.
Better Support: Developers get better support. This leads to smoother and more efficient development.
New Features: Modern language features help create new functionalities. This means your projects get cool new capabilities.
Drawbacks of translating code from one language to another
Performance Issues:
Translated code might not be optimized, causing slower execution and reduced performance.
Maintenance Challenges:
Harder to maintain, especially with complex logic and different debugging tools.
Compatibility Problems:
New language may lack certain features, leading to functionality loss or extensive rewrites.
The implications and impact of translating code
Performance:
May Improve or Decline: Translated code might perform better or worse depending on the efficiency of the new language or platform.
Maintenance and Bug Fixes:
Old Solution Neglect: Existing system may lack maintenance and bug-fixes while transitioning to the new solution.
Organizations:
New Tools and Resources:
Costs: Investment in new development environments, programming languages, and support materials.
Staffing:
Hiring/Training: Need to hire new programmers or train existing staff.
Financial Justification:
Costs: Development of a new solution incurs costs, requiring justification for the investment.
Developers:
Skill Development:
Learning: Opportunity to acquire new skills and knowledge.
Challenges:
Personal and Professional Growth: Adapting to a new programming language and environment can be challenging but rewarding.
Decomposition
Definition: Breaking down a complex problem into smaller, manageable tasks
Purpose: Simplifies understanding, development, and maintenance of a program.
Application: This involves identifying major components of a system, defining their functions, and then developing each component independently.
Pattern recognition
Definition: Identifying and understanding the patterns within problems or datasets.
Purpose: Helps in reusing existing solutions and improving efficiency.
Application: Involves analysing data or problems to find repeated sequences, behaviour, or structure that can be leveraged to solve new problems more efficiently.
Abstraction
Definition: Removing unnecessary details to focus on the essential features of a problem or system.
Purpose: Reduces complexity and makes the problem easier to handle.
Application: Creating simplified models or representations of complex systems by focusing on relevant attributes while ignoring irrelevant details.
Algorithm design
Definition: Creating a step-by-step procedure or set of rules to solve a specific problem.
Purpose: Ensures a clear, efficient path to achieve a desired outcome.
Application: Involves defining the logical sequence of actions to be performed to transform input into the desired output, which can then be implemented in a programming language.
Built in functions advantage
Easy Maintenance: Standard functions make your code easier to manage, reducing complexity and making future updates simpler.
Reliable: Built-in functions typically have fewer bugs, as they are tested and optimized by experts, leading to smoother performance.
User-Friendly: Ready-to-use functions save you time and effort by simplifying the coding process, allowing you to focus on the unique aspects of your project.