• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/67

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

67 Cards in this Set

  • Front
  • Back

Five major parts of a computer

Main memory, secondary memory (usb), CPU, input devices, output devices

Difference between secondary memory and main memory

Main memory is RAM (volatile) and within the computer. Secondary memory can hold data for long periods of time (like USBs)

What is a program?

Set of instructions that a computer performs to complete a task

What is the difference between a high-level and a low-level programming language?

High-level languages allow you to create programs without knowledge of how the CPU works. Low-level languages requires that you use mnemonics and have some knowledge of the CPU.

Compiler

program that translates a high-level language into a separate machine language program

interpreter

program that both translates and executes the instructions in a high-level language program

2 types of software

system software and application software

System software

runs the computer, like Windows or Apple OS

Application Software

secondary software not necessary for the processes of the computer, like Skype or MS Word

Assembler

special program that is used to translate assembly language into machine language

A Byte

8 bits makes one byte. the way computer memory and storage is divided.

Bit

binary digit= bit. think of it like a tiny "on/off" switch for the computer to read/write data

Fetch->decode->execute cycle

fetch data-> decode and understand the instruction-> execute the instruction

pseudocode

fake code used as practice before implementing actual computer code

Flowchart

graphical way of designing a program

Input and output

input some data, stuff is calculated, output the answer to calculation

Variables and rules

storage location that is represented by a name


rules: names must be one word with NO spaces


punctuation characters cannot be used in variable names


first character of a name cannot be a number

String

use of characters instead of numbers

=

is used to assign a declared variable


ex: var A = 5

Named constant

a variable that cannot be changed during a program


ex: Constant_Var = 10

hierarchy of arithmetic operations

Parenthesis> exponents>Mult>Div>Modulus (divides one number another and gives the remainder) >addition> subtraction


all performed from left to right


PEMMDAS


(2+5)^2 * 1 /1 + 3-1

variable declarations and data types

a statement that tells the program 2 things: variables name and data type


i.e. string, integer, boolean

variable initialization

declaring a variable and then assigning it


ex: var Price= 28.50

uninitialized variable

a declared variable with no assigned value


ex: Declare Integer "sentinel"

external documentation

describes aspects of the program for the user

internal documentation

describes how the program works for the programmer

benefits of a module

simpler code, code resuse, better testing, easier maintenance, faster development, easier facilitation of teamwork

defining a module

modules contain a header and a body. header is the starting point of the module. the body are the lines or statements that belong to the module

calling a module

ex: Call Main Module()


the computer executes the statements of the module then jumps back to the main program

Flowcharts and designing a module

flowcharts show the logic inside a module. either through hierarchy or structure charts, boxes represent modules and show how they are related to each other

pass by value

passing values between calling a program (arguments) and a module( parameters). only a copy of the arguments are passed into a parameter variable. changes in content to a parameter value doesn't affect the content of the arguments in calling the program

pass by reference

arguments are passed into a special type of parameter known as a reference variable which allows a module to modify the argument in the calling part of the program

global variables

variables known by and potentially used by every module in a program. any module can make changes to global variables

global variable restriction

they make debugging difficult


changes to global variables in one module may require changes in these variables and other modules


they make the program difficult to understand

Types of decision structures

single-alternative =if-then


dual-alternative= if-then-else

What is a case structure?

It's a multiple alternative decision structure that allows you to test the value of a variable or expression and determine which sets of instructions to execute after

What are the logical operators?

AND (both statements must be true)


OR (one of the statements have to be true)


NOT (reverses the truth of the Boolean expression)

What is a relational operator?

determines whether a specific relationship exists between 2 values



Types of relational operator

> (less than)


< (greater than)


>= (less than or equal to)


<= (greater than or equal to)


== (equal to)


!= (not equal to)

How do computers compare strings?

They compare the numeric value that corresponds with the character

Nested decision structure

when a decision structure is within another decision structure

3 Major control structures

Sequence structure = set of statements


single-alternative = if-then


dual alternative= if-then-else

Condition-controlled loop

uses true/false condition to control how many times a loop will iterate

Count-controlled loops

uses a specific number to control how many times the loop iterates

3 types of condition-controlled loops

While, do-while, do-until

Parts of a loop

initialization, test, increment/decrement

What are pretest loops?

Loops that test their condition before iterating


ex: while and For loops

Posttest loops

iterate before testing their condition


ex: do-until and do-while

Accumulators

calculates a running total

sentinels

prevents an infinite loop. it's a way of inserting a condition to make the loop stop or make the condition false.

What's a function?

group of statements that perform a specific task but returns a value when it is called, unlike a module

Library functions

functions that are built into the programming language

Random number generator

a function that generates a random number. useful in security

IPO Chart

Input, processing, output


a chart that describes the input, processing, and output of a program

GIGO

garbage in, garbage out


the idea that if a program reads bad data, it will produce bad data

input validation

a loop that iterates every time the user inputs bad data, which will only execute the next statements in the program once the data is valid

defensive programming

the practice of anticipating errors and designing programs to avoid those errors. input validation is a practice of defensive programming

Sequential search

simple way of for finding an item in an array. it looks for the item in order comparing the previous data to the next

Off-by-one errors

when a loop iterates one too many or too few times


ex: For index= 0 -- SIZE-1


N [index]= 1-SIZE

Bounds checking

where a programming language does not allow an array to use an invalid subscript

parallel arrays

2 or more arrays that hold related data


ex: an array for student IDs and an array for student test scores

2 and 3 dimensional arrays

are several identical arrays put together. useful for storing multiple sets of data

Bubble sort

sorts data in ascending or descending order. it's called this because certain values bubble towards the end

swapping elements

assign a temp variable and swap as many times as needed


ex: temp = a


a=b


b=temp

selection sort

uses fewer swaps because it moves items immediately to their final position in the array

insertion sort

more efficient than bubble sort


sorts the first 2 elements, compares elements and if necessary will swap elements into the correct order

binary search

is more efficient than a sequential search.it divides the array in half repeatedly until it locates an item but discards the half that does not have the item