Intro to Computers and Programming Flashcards
What is a Computer?
A programmable electronic device that can store, retrieve and process data.
What are the advantages of a computer?
Reliable, Fast, Does not tire, Follows instructions precisely
What are the disadvantages of a computer?
Cannot analyze problems, Follows instructions more precisely than humans do
What can a computer do?
Simple aritmetic, Comparisons/decision making, Communication
What are the Components of a Computer?
Input devices, CPU, Main Memory, Secondary Memory, Output devices
What is a CPU
Central Processing Unit- fetches and follows a set of simple instructions(also called the processor)
What is the Main Memory?
storage for the executing program and its data in RAM (random access memory). Volatile.
What is secondary memory?
storage for permanent records (files). Non-volatile.
What are the parts of a CPU?
ALU and Control Unit
What is an ALU?
Arithmetic and Logic Unit- performs mathematical operations
What is the Control Unit?
coordinates all of the computer’s operations, performs the fetch/decode/execute cycle.
What are the two types of Software?
Operating Systems and Programs.
What does an operating system do?
allocates the computer’s resources and allows communication between user and computer.
What is a program?
a set of instructions to perform specific tasks.
What is an algorithm?
a set of well defined steps for performing a task or solving a problem.
What is the relationship between an algorithm and a program?
A program is an algorithm that has been translated into a programming language so that the computer and understand and perform the steps.
What is a programming language?
a special language used to write programs.
What are the three types of programming languages?
High-level, Low-level, and Machine
What is a High-Level Language.
designed to be easy for humans to read and to write programs in, but too complicated for the computer to understand.
What is a Low-Level Language?
consists of simple instructions which can be understood by the computer after a minor translation.
What is Machine Language?
written in the form of zeros and ones, can be understood directly by the computer.
What is the process in which source code becomes executable code?
Source Code goes through the preprocessor, becomes modified source, then the compiler, becomes object code, then the linker to become executable code.
What are the main Language Elements?
Key Words, Programmer Defined Symbols, Operators, Punctuation, Syntax
What are Key Words?
reserved words that have a special meaning.
What are Programmer Defined Symbols?
words or names that have been defined by the programmer. May be variables, constants, or functions/routines.
What are operators?
symbols to tell the computer to perform specific operations.
What is punctuation in programming?
symbols to begin or end a statement or separate items of a list.
What is syntax?
grammar rules for combining elements.
What does the double slash (//) signify?
The beginning of a one line comment
What does the slash asterisk (/* */) signify?
a comment is enclosed
What does the octothorp (#) signify?
the beginning of a preprocessor directive.
What do brackets (<>) signify?
an enclosed filename or datatype.
What do parentheses signify?
contains the parameters for functions or changes the order of operations
What do braces ({}) signify?
a group of statements being enclosed.
What does a semicolon (;) signify?
The end of a C++ statement.
What are the three phases of writing programs?
The Problem Solving Phase, Implementation Phase, and The Maintenance Phase.
What steps occur in the Problem Solving Phase?
Analysis & Specification, General Solution, Verification
What steps occur in The Implementation Phase?
Concrete solution, testing
What steps occur in the Maintenance Phase?
Use, Maintain
What are the three main types of Programming Errors?
Syntax errors, Logic errors, Run-time errors.
What are syntax errors?
code that does not follow the grammar rules of the language. These are found by the compiler.
What are logic errors?
Results are incorrect because of an error in implementation. These are found by using test data.
What are run-time errors?
when the program causes the computer to perform an illegal operation, such as dividing by 0 or finding the square root of a negative number.
What is Input?
data the user of the program will need to enter into the program.
What is Output?
information the user expects to receive from the program.
What is Processing?
What the program does to the input to produce the output.
What is Procedural Programming?
focuses on the development of procedures (functions) to solve problems.
What is Object Oriented Programming?
developing objects that are a combination of procedures.
What are the four main parts of a program?
Comments, Preprocessor Directives, Functions, and Statements.
What are comments?
describe what the program is supposed to do and what various portions do. Often used as documentation.
What are Preprocessor Directives?
directions to perform before program starts.
What are funcitons?
groups of statements to perform a specific task.
What are Statements?
actions executed by the computer.