CS110 Algorithms 1 Study Guide

Unlock all answers in this set

Unlock answers
question
Algorithm
answer
-a formula or set of steps for solving a particular problem. -set of rules must be unambiguous and have a clear stopping point -can be expressed in any language, from natural languages to programming languages -any well defined computational procedure that takes some value or set of values as input and produces some value or set of values as output
question
Computer Programming
answer
writing, testing, and implementing code necessary to make certain functions happen on a computer
question
Programming Language
answer
a vocabulary and set of grammatical rules for instructing a computer to perform specific tasks
question
Language
answer
-as C, FOTRAN, or Pascal that enables a programmer to write programs that are more or less independent of a particular type of computer -such languages are considered high-level because they are closer to human languages and further from machine languages
question
Low Level Programming Language
answer
-a machine language or an assembly language -low level languages are closer to the hardware than are high level programming languages, which are closer to human languages
question
Programming Syntax
answer
-syntax refers to the spelling and grammar of a programming language -computers are inflexible machines that understand what you type only if you type it in the exact form that the computer expects -the expected form is called the syntax -the format, which covers the spelling of language and components and the rules controlling how components are combined
question
Programming Semantics
answer
-in linguistics, the study of meanings -in computer science, the term is used to differentiate the meaning of an instruction from its format
question
IPO (Input-Processing-Output)
answer
a fundamental design of how a system or computer program works
question
Input
answer
-whatever goes into the computer input can take a variety of forms, from commands you enter from the keyboard to data from another computer or device -a device that feeds data into a computer, such as a keyboard or mouse, is called an input device -before a computer can operate on data, the data needs to be entered or inputted
question
Output
answer
-anything that comes out of a computer -output can be meaningful information or gibberish, and it can appear in a variety of forms -- as binary numbers, as characters, as pictures, and as printed pages -output devices include display screens, loudspeakers, and printers -the result that is displayed after the input is processed
question
Processing
answer
something is done with the input to calculate the output
question
Pseudo-Code
answer
an outline of a program, written in a form that can easily be converted into real programming statements
question
Instruction
answer
-a basic command -often used to describe the most rudimentary programming commands
question
Variable
answer
-symbol or name that stands for a value -plays an important role in computer programming because they enable programmers to write flexible programs -rather than entering data directly into a program, a programmer can use variables to represent the data -then, when the the program is executed, the variables are replaced with real data -this makes it possible for the same program to process different sets of data -something that can store a piece of data
question
String Variable
answer
computing data on which arithmetical operation will not perform; a variable that contains letters or numbers in which a numeric operation cannot be performed
question
Numeric Variable
answer
-symbolic name of a data element whose value changes during the carrying out of a computer program; one that can hold digits, have math operations performed on it, and usually can hold a decimal point and a sign indicating positive (+) or negative (-)
question
Computer Program
answer
-an organized list of instructions that, when executed, causes the computer to behave in a predetermined manner -without programs, computers are useless
question
Initialize a Variable
answer
to assign a starting value to a variable
question
Accumulate Values
answer
values that increase in increments throughout a program
question
Logical Operators
answer
-NOT, AND, OR -an operator that uses logical data as operands to produce logical data as a result
question
Arithmetic Operators
answer
-in formulas, symbols that perform mathematical calculations -uses mathematical functions (+,-,*,/)
question
Condition
answer
the entity that determines the action taken by the program each time it is run
question
What are the steps involved in using the computer as a problem solving tool?
answer
1.) develop an algorithm and a flow chart 2.) write the program in a computer language 3.) enter the program into the computer 4.) test and fix the program as necessary 5.) run the program, input the data, and get the output from the computer
question
What are the five basic symbols used in a flow chart?
answer
Start or stop: Rectangle with rounded edges Computational or processing: Rectangle Input or Output: Parallelogram Decision: Diamond Connector: Circle
question
What are the advantages of a high level programming language?
answer
-high level programming languages are easier to read, easier to understand, easier to learn, easier to use -syntax is the structure, while semantics are the meaning -the syntax informs the semantics
question
Increment/Decrement a Variable
answer
-increment: to add a fixed amount --if you count consecutively from 1 to 10 you increment by one --if you count by twos, you increment by two -decrement: decrease variables by a specified number
question
Counter
answer
variable whose value is the address where the next instruction of data element will be assembled into memory
question
Iterate
answer
to execute (programs) a single pass through a set of instructions
question
loop
answer
a piece of code that causes the program to ask a question repeatedly and carry out action repeatedly until the answer is such that the action is no longer required
question
Modulus Operator
answer
works with numbers and yields the remainder when the first operand is divided by the second
Get an explanation on any task
Get unstuck with the help of our AI assistant in seconds
New