Programming Languages (Ch10) (M2) Flashcards

1
Q

What is an IDE?

A

An IDE is software used to write code and create programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Visual Studio is an example of what?

A

Visual Studio is an example of an IDE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give three reasons why IDEs are helpful for programmers

A

IDEs are helpful, because they:

-Help programmers to produce correctly working and efficient programs
-Help programmers to produce readable and easy to understand code through features such as commenting and indentation.
-Help to solve syntax errors, logic errors and run time errors.
-Reduce the overall time spent creating programs.
-Reduce the overall time spent debugging programs.
-Compile the code and translating it from a high level language like VB, to low level binary for the computer to understand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of break points?

A

Break points interrupt a program on a specified line, making it possible to step through, examine variables and find run-time errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the purpose of error diagnostics?

A

It describes the type of error and identifies errors through colour coding
Describes the error and indicates the line
Feeds back to the user when compilation is unsuccessful

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Give 6 features of an IDE that make it useful for programmers

A

IDE Features:

Coloured keywords in source code
Comment out and indent sections of code
Autocorrector
Run-time environment and output window
Debugging tools
Tracing the value of variables
Project navigation panel
Main menu and toolbar with access to a host of features to help manage the program
Auto-code completion to speed up programming
Errors produced when the compiler translates the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does a source code editor do? Why is it useful? Give an example

A

It is a software application used for writing and editing computer code

It provides programmers with a platform for writing, modifying and testing code

Notepad, Wordpad, Visual Studio

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does autocomplete do? Why is it useful? Give an example

A

A feature that predicts the rest of a word that a user is typing

Speeds up writing code

Google, Visual Basic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does bracket matching do? Why is it useful? Give an example

A

A specific text editor that highlights sets of matching brackets

Helps the programmer to navigate through the code and spot any improper matching

Java, Javascript, C++

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the debugger do? Why is it useful? Give an example

A

A debugger locates and then removes bugs or errors in a program

Allows programmers to examine the state of a running program

Visual Studio debugger, Arm DTT, Firefox Javascript debugger

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the single-stepper do? Why is it useful? Give an example

A

It is one of the most powerful features of a debugger. It allows reverse engineers to execute a single instruction at a time

Allows a reverse engineer to execute a single instruction at a time before returning control to the debugger

Visual studio, Visual basic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do breakpoints do? Why are they useful? Give an example

A

A breakpoint is a point in the program where the code will stop executing

Allows coders to write particular sections of the code without immediate execution

Eclipse, NetBeans, Visual Studio, Visual Basic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does variable tracing do? Why is it useful? Give an example

A

Lets the programmer see the changing values of variables as the program runs

Enables the programmer to check that the program is functioning as expected

Visual studio, Visual basic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does commenting do? Why is it useful? Give an example

A

Allows you to write extra notes that the computer ignores

Makes the code easier to understand and more maintainable

Visual studio, Visual basic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does line numbering and indentation do? Why is it useful? Give an example

A

Line numbering is putting numbers on each line of code.
Indentation is leaving a space on a line, before beginning your code.

Makes the code more readable and maintainable

Visual studio, Visual basic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Give two features of an IDE and explain their use

A

Source Code Editor
It is a software application used for writing and editing computer code It provides programmers with a platform for writing, modifying and testing code

Autocomplete
A feature that predicts the rest of a word that a user is typing Speeds up writing code

Bracket Matching
A specific text editor that highlights sets of matching brackets Helps the programmer to navigate through the code and spot any improper matching

Debugger
A debugger locates and then removes bugs or errors in a program Allows programmers to examine the state of a running program

Single-stepper
It is one of the most powerful features of a debugger. It allows reverse engineers to execute a single instruction at a time
Allows a reverse engineer to execute a single instruction at a time before returning control to the debugger

Breakpoints
A breakpoint is a point in the program where the code will stop executing Allows coders to write particular sections of the code without immediate execution

Variable Tracing
Lets the programmer see the changing values of variables as the program runs Enables the programmer to check that the program is functioning as expected

Commenting
Allows you to write extra notes that the computer ignores Makes the code easier to understand and more maintainable

Line Numbering and Indentation Line numbering is putting numbers on each line of code. Indentation is leaving a space on a line, before beginning your code.
Makes the code more readable and maintainable

Error Diagnostics
It describes the type of error and identifies errors through colour coding
Describes the error and indicates the line
Feeds back to the user when compilation is unsuccessful

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What do error diagnostics do? Why are they useful? Give an example

A

It describes the type of error and identifies errors through colour coding
Describes the error and indicates the line
Feeds back to the user when compilation is unsuccessful

Helps with debugging code, ensures code is correct

Visual studio, Visual basic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Give two methods of translating high-level source code

A

Interpreting
Compiling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is assembly language always translated using?

A

Assembly languages are always translated into machine code using an assembler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Describe how a compiler translates the source code into executable code

A

Translates source code from high-level languages into object code and then into machine code ready to be processed by the CPU.
The whole program is translated into machine code before it is run.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Give two advantages of a compiler

A

Advantages of a compiler:

-No need for translation software at run-time
-Speed of execution is faster
-Code is usually optimised
-Original source code is kept secret

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Give two disadvantages of a compiler

A

Disadvantages of a compiler:

-Source code is easier to write in a high-level language, but the program will not run with syntax errors which can make it more difficult to write the code
-Code needs to be recompiled when the code is changed
-Designed for a specific type of processor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Describe how an interpreter translates the source code into executable code

A

Translates source code from high-level languages into machine code ready to be processed by the CPU.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

How is the program translated, using an interpreter?

A

The program is translated line by line as the program is running. It will stop to tell the user of any mistakes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How is the program translated, using a compiler?
A compiler translates all the code at once, and then reports errors at the end
26
Which translator produces an executable file?
A compiler creates an executable file
27
Which translator can optimise the code?
A compiler can optimise the code
28
Give two advantages of an interpreter
Advantages of an interpreter: -Easy to write source code because the program will always run, stopping when it finds a syntax error -Code does not need to be recompiled when code is changed, and it is easy to try out commands when the program has paused after finding an error -This makes interpreted languages very easy for beginner programmers to learn to write code
29
Give two disadvantages of an interpreter
Disadvantages of an interpreter: -Translation software is needed at run-time -Speed of execution is slower -Code is not optimised -Source code is needed
30
Which translator is cross platform?
An interpreter is cross platform
31
Which translator has private source code?
Compilers have private source code
32
Which translator makes it easiest to test the code?
A compiler makes it easier to test the code
33
Which translator is usually faster?
A compiler is often faster than an interpreter
34
Give one example of a compiled programming language
Compiled programming languages: C C++ Objective-C
35
Give one example of an interpreted programming language
Interpreted programming languages: PHP JavaScript
36
Give one example of a hybrid translated programming language
Hybrid translated programming languages: Java C# VB.NET Python
37
What was short code?
Short code was the first ever high-level language
38
What type of language is assembly classed as?
Assembly is a low-level language
39
What were commands in low-level languages closely mapped to?
They were closely mapped to machine architecture and were written for a specific processor
40
Give two advantages and disadvantages of low-level language
Advantages: -Incredibly efficient -Allow programmers to express programs using simple commands -Commands can be easily translated into machine code -The programmer works with the memory directly -Code is fast to execute Disadvantages: -Requires a great deal of intellectual effort because it is hard to understand and write -The code works on one type of processor only
41
What two factors led to an explosion in the use of high-level languages?
Increased processor speed Increased memory capacity
42
Give four examples of high-level languages
Python C C++ C# Visual Basic Java Lua HTML
43
Assembly languages are now reserved for specialist situations. Give two examples.
Embedded systems Device drivers
44
What language can low-level languages be easily translated to?
They can be easily translated into machine code
45
What is machine code?
Machine code is a binary representation of instructions in a format that the CPU can decode and execute
46
What are the two parts of machine code?
Machine code has an operation code (opcode) instruction and address or data to use (operand).
47
Give three features of low-level languages
Written in Assembly language Translated by an assembler into machine code Used for embedded systems and device drivers where instructing the hardware directly is necessary One instruction translated into one machine code instruction
48
One instruction in a low-level language is translate into what?
One instruction is translated into one machine code instruction
49
Give two advantages and disadvantages of high-level languages
Advantages: -Makes the writing of computer programs easier by using commands that are like English -The programmer has lots of data structures to use -Code is quicker and easier to understand and write Disadvantages: -Code will run on different types of processors -Less memory efficient -Code can be slower to execute if it is not optimised
50
What is machine code directly executable by?
Machine code is directly executable by the processor
51
Give one advantage and two disadvantages of machine code
Advantage: -Directly executable by the processor Disadvantages: -Always written in binary -Difficult to program in -Hard to understand -Difficult to debug, due to difficulty understanding the code
52
What does assembly code use, that makes it easier to understand than machine code?
Assembly code uses mnemonics (LOAD, ADD, DIV, STA)
53
Give two advantages of source code:
Advantages of source code: -Easier for the programmer to understand -Easier to debug -Uses English-like keywords -One instruction translates into many machine code instructions
54
Describe the 4th generation of code
4th Generation: -Known as a Declarative language -Facts and rules are stated -Describes what computation should be performed and not how to perform it -Examples include: SQL, Expert Systems, Artificial Intelligence
55
Give an example of a 4th generation language
Examples include: SQL Expert Systems Artificial Intelligence
56
Describe the 3rd generation of code
3rd Generation - Source Code: -Easier for the programmer to understand -Easier to find errors, easier to debug -Uses English-like keywords -One instruction translates into many machine code instructions -Examples of source code are: Java, Visual Basic, Pascal, C+
57
Give an example of a 3rd generation language
Examples include: Java Visual Basic Pascal C+
58
Describe the 2nd generation of code
2nd Generation - Assembly Code: -Use mnemonics (LOAD, ADD, DIV, STA) -Easier to program in than 1st Generation but still difficult -One Assembly Language instruction translates to one Machine Code Instruction (1-1 relationship) -Despite being difficult to debug, it still has its uses -It is most commonly used to program Device Drivers (Device drivers are loaded into memory by the Operating System and used to control the operation of a Hardware Device, e.g. Graphics Card Drivers, Printer Drivers)
59
What language is the 2nd generation of code?
The 2nd generation of code is assembly language
60
Describe the 1st generation of code
1st Generation - Machine Code: -Directly executable by the processor -The generation that "computers understand" -Difficult to program in, hard to understand, hard to find errors (hard to debug) due to difficulty understanding the code -Always written in binary
61
What is assembly code?
Assembly code uses mnemonics and is easier to program than machine code. Despite it being difficult to debug, it still has its uses and it is most commonly used to program device drivers
62
What is source code?
Source code uses English-like keywords, making it easier for the programmer to understand and making it easier to debug. One instruction translates into many machine code instructions
63
Compare high level and low level languages
High Level Language: High level languages are easier for the programmer to understand, easier to debug and use English-like key words Low Level Language: Low-level language allow programmers to express programs using simple commands which can be easily translated into machine code