1.8 Programming Q Flashcards

1
Q

Purpose of computer program

A

Specific set of ordered instructions to be performed by a computer.

Program represents solution to a problem.

Execute 1 introduction at a time (in sequence)

Can be written in high level language c#

Can be written in low level machine code

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

How IDEs used to create computer programs

A

Program code created using code editor.

Code then translated into machine code.

Source code not be executed unless fully compiled.

IDEs provides programmers with facilities required to complete development from coding to testing.

IDE consist of..

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

IDEs consist of

A

Source code editor - can enter code

Compiler- program can run

Debugger- error correction as u enter code

GUI- intuitive interface

Solution explorer- view files associated w program.

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

Describe 2 examples of how IDEs help SW developers in the production of error free code

A

Debugging- can be used to detect and correct problems automatically if commands incorrect.

Syntax error assistance- as code entered
Code editor will place wavy line beneath code incorrect or cause problem.

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

What happens when an IDE debuts program

A

IDE works through the program in a systematic way

Finds code that is not producing accurate results.

Debugger used to detect and correct these issues.

Can set breakpoints where the program will stop during execution, allowing programmer to view results at that stage and examine code.

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

How breakpoints used in production of computer program

A

Programmer set point which code stop executing (otherwise run until end)

Allows results of processing to be examined at breakpoint.

If program does not run programmer can use breakpoints to find sections of source code do not contain errors by allowing them to run up to breakpoint.

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

Role of an interpreter during process of translation

A

Translates SC one line at a time.

Processor executes one line of code before moving into next.

No version of machine code is stored.

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

Role of compiler during translation

A

Convert whole program at once into machine code before executing it.

Syntax of each statement is checked.

If incorrect, compiler will generate list of errors.

Cannot be executed unless all syntax errors removed.

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

C+C role played by interpreters and compilers in translating source code

Similarities

A

BOTH are translating source code into machine code for computer to understand

BOTH will not execute code if contains syntax errors.

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

C+C role played by interpreters and compilers in translating source code.

Differences

A

INTERPRETER translates one line of code at a time.
COMPILER translates whole program at one time.

Execution time slower w INTERPRETER

COMPILER does not identify which line of code contains an error.

INTERPRETER does not run the line of code if there is an error.

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

What is an algorithm

A

Set of rules for a computer program.

Carried out in order.

Represent solution to a problem.

Can break down any problem into a series of ordered steps.

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

Role of syntax in creation of computer program

A

Set of rules that govern how statements should be structured.

Each programming language has own unique syntax.

Syntax errors are identified during process if translation.

Specifies how commands should be used to create statements.

Statements make up source code.

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

What is meant by count controlled loop

A

Variable is used to control number of times instruction carried out.

Variable known at “loop counter” to set an initial value of counter.

Each time loop executed, counter is incremented.

Sequence carried out SET NO. OF TIMES.

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

What is meant by iteration

A

Ability to repeat line of code many times.

Expressed through loops.

Iteration= each time a repeated instruction is carried out.

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

Objects

A

Instance of a class

Stores data about a person or thing.

Can perform actions and interact with other parts of program.

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

Methods

A

Section of code contained within a class.

Defines an action of an object that a class can perform.

A class can have several methods.

Methods only have access to data in their class.

17
Q

Classes

A

Way of defining

Attributes that an object can possess
Methods that are used to manipulate their properties of an object.

Classes can have a sub class which inherits attributes from parent class.

18
Q

Inheritance

A

Fundamental feature of OOP

a new class can inherit the attributes and behaviours of the existing class.

The new class is known as a sub class.

Existing class is known as parent class.

Sub class inherits attributes from parent class.

Sub class can have own attributes.

19
Q

How methods, objects and inheritance can be used to create better SW.

A

Classes and methods can be reused in other programs and apps.

Objects can be extended to include other behaviours and attributes.

Reusing enables faster development and lower overall costs.

Encapsulation- once an object is created it can be used without knowledge of how it was implemented.

With inheritance the testing of a derived class can assume the base class is correct and can focus on additional attributes and behaviours.

20
Q

What’s an integrated development environment

A

An application used to create SW.

Contains the poems tools developers need to write and test SW.

21
Q

Source code editor features

A

Intellisense or autocompletion

Bracket matching

Syntax error assistance.

22
Q

Data types

A

Int whole numbers

Double decimals.

Char single characters.

String test anything.

Date.

Time.

Boolean.

23
Q

Variables

A

Place holders or storage boxes to store values in memory.

Each storage box given unique name.

Type of data permitted is assigned.

Variables allow program to store values that are required during the execution of the program.

24
Q

Why a program might need to be translated

A

Computers operate in binary/ machine code.

Programming languages are designed to be understood by humans.

These include high level languages.

A program must be converted to binary before computer can execute it.

25
Q

What is meant by condition controlled loop

A

Sequence of instructions executed/ repeated while a condition is true.

Condition tested at start of loop or until condition becomes true.

In which case condition tested at end of loop.