Docsity

Computer Science Basics: Software Dev, Data Types, Algorithms, and Programming, Quizzes of Electrical and Electronics Engineering

Partial preview of the text

Download Computer Science Basics: Software Dev, Data Types, Algorithms, and Programming and more Quizzes Electrical and Electronics Engineering in PDF only on Docsity!

3 Phases of Software Development

Development and DesignDocumentationMaintenance

TERM 2

4 Phases of Design and Development

DEFINITION 2

AnalysisDesignCodingTesting

TERM 3

Algorithm

DEFINITION 3

Step-by-step sequence ofinstructionsthat must terminate

TERM 4

Two Low-Level Computer Languages

DEFINITION 4

Machine-LevelAssembly

TERM 5

High Level Computer Languages

DEFINITION 5

Visual BasicCC++Java

Parts of a Computer

Arithmetic and Logic Unit (ALU)Control UnitMemory UnitInput

and Output Units (I/O)Central Processing Unit

(CPU)Secondary StorageMicroprocessor

TERM 7

Data Types

DEFINITION 7

Built InsUser Defines (classes)The types of data permitted

and the operations allowed for each typeDefined set of

values and a set of operations that can be applied to these

values

TERM 8

Arithmetic Operators

DEFINITION 8

The operators used for arithmetic operations(+,-,%,*,/)

TERM 9

Declaring Variables

DEFINITION 9

Use a declaration statement (initializethe variable)Ex: int

variableName;

TERM 10

Naming an Identifier

DEFINITION 10

Constants arecapitalizedCannot name an identifier after a

functionCannot have spaces in the name

Constant

Some value that is kept constant throughout the

programValues that can be used in multiple statements

without changing their value

TERM 17

Relational Operator

DEFINITION 17

A statement that compares two values using ( <, >, ==)

TERM 18

Logical Operator

DEFINITION 18

A statement that compares values using (&&, ||, !) = ( AND,

OR, NOT )

TERM 19

Selection

Statements

DEFINITION 19

Allows you to make a choice and breakssequentialflow in a

program (if-elsestatements)

TERM 20

Alternative Selection Statement

DEFINITION 20

A switch staement

How to Make a Selection Statement Control

More Than One Line of Code

Use curly braces

TERM 22

Pre-Test Loop

DEFINITION 22

A loop that has to meet a condition before the loop is

executed

TERM 23

Post-Test Loop

DEFINITION 23

A loop that uses a condition at the end of the execution

TERM 24

Comparing Pre/Post-Test Loops

DEFINITION 24

Post-Test Loops are guarenteed to run at least once, while

pre-test may not run at allThey both have conditions they

have to pass to continue executing

TERM 25

Comparing Selection Statements and

Loops

DEFINITION 25

Selection Statements run a defined number of times, while a

loop will run until the condition is met

Scope

The section of the program where the identifier, such as a

variable, is valid or knownExtend scope by using Global

Scope

TERM 32

Variable Lifetime

DEFINITION 32

How long a variable stays in a

programTypes:StaticAutoRegister

TERM 33

Declaring an Array

DEFINITION 33

Create a constant for the number of items in the arrayUse a

declaration statement with brackets containing a constant

TERM 34

Initializing an Array

DEFINITION 34

Use a declaration statement to fill the elements of the array

TERM 35

Selection Sort

DEFINITION 35

Assume the first value is smaller, check all other values,

replace the next smallest value with the initial value

Arrays Passed to a Function

Pass-by-Reference

TERM 37

C++ View of Data Inputs and Outputs from

Files or Standard Devices

DEFINITION 37

Uses streams to view them

TERM 38

C++ Processing of Data

DEFINITION 38

Sequentially (frombeginningto end)

TERM 39

Getline

DEFINITION 39

Extracts and returns characters from the input stream until n-

1 characters are read or a newline is encountered

TERM 40

Ignore

DEFINITION 40

Skips over the next n characters

What does *

do?

Dereferences a pointer

TERM 47

What does ->

do?

DEFINITION 47

A pointer and dereferencer all in one(*x).getNamethis-

>x.getName

TERM 48

Declaring a Pointer

DEFINITION 48

int *x;

TERM 49

Allocating Memory Dynamically

DEFINITION 49

int *x = new int[10];

TERM 50

Reference vs. Pointer

DEFINITION 50

Both store addressesThe value at the address of a pointer

can be changed since it is a variableA pointer also has to be

dereferenced

Classes

Class is private bydefaultClasses have the data and

operationsclass "name of class"{private:public:};

TERM 52

Structures

DEFINITION 52

Public bydefaultOnly has the dataOrganizes datastruct

"name of structure"{};

TERM 53

Data Hiding

DEFINITION 53

Making data privateShowing only what you want the user to

see

TERM 54

Constructor

DEFINITION 54

A constructorinitializesdataHas no return type and has the

same name as the classCalled by the function name followed

by parenthesis ( )Board::Board(){}

TERM 55

Setter Method

DEFINITION 55

Modifies the data/private fields