CS 1301 Vocab

  1. Hierarchy of Data
    • Bit
    • Character
    • Field
    • Key Field
    • Record
    • Table/File
    • Database
  2. Bit
    • American Standard Code for Information Interchange (ASCII) base level
    • 1,0
  3. Character
    • ASCII codes combining bits
    • 1. letter
    • 2. decimal
    • 3. hexagonal
    • 4. octoganal
    • 5. binary
  4. Field
    • Combination of characters, many types
    • ex. first name
  5. Key Field
    unique set of fields, made unique by at least one field (gt id)
  6. Record
    line of fields
  7. Table/File
    collection of records
  8. Database
    collection of tables/files
  9. volatile memory
    computer memory that goes away as soon as power is lost
  10. nonvolatile memory
    computer memory that stays even without power (hard drive, CD)
  11. RAM
    • random access memory
    • loads a program into the volatile memory (microsoft word)
    • affects computer speed
  12. ROM
    • read-only memory
    • memory stored somewhere constant (non-volatile)(USB)
  13. machine languages
    computer language with only on off switch (binary)
  14. assembly languages
    • computer language with step-by-step elementary instructions for computer
    • fastest to communicate with computer
    • ex. "push" "move"
  15. high-level languages
    language we type and understand that has to be translated to machine language by program, which is then sent to computer
  16. assemblers
    translator program to convert assembly language into machine language
  17. compilers
    translator program to convert high-level language into machine language
  18. kernel
    software that contains core components of operating system
  19. algorithm
    specific set of instructions to solve a category of problems
  20. program
    sequence of instructions that specifies actions for the computer to perform
  21. interpreter
    engine that executes scripts/expressions to be processed by computer
  22. runtime error
    • error occurs as program is running that then prevents it from continuing to run
    • aka exception
  23. syntax
    language structure of program
  24. syntax error
    error in program where computer cannot even interpret command
  25. semantics
    the meaning behind the program
  26. semantic error
    • error not within code (syntax error) or within commands (exception) but within idea that gives unintended eror
    • aka logic error
  27. Problem Solving steps
    • 1. Formulate problem
    • 2. Find a solution
    • 3. Express solution
  28. formal language
    • language designed for a specific purpose
    • ex. a computer code
  29. immediate mode
    type in command in Python immediately see result, seen in Python Shell
  30. object code
    output of compiler after translator
  31. parse
    examining syntax of program code
  32. portability
    how easily a program can run on multiple computers
  33. print function
    • print ("example") gives string: example
    • print (example) gives command result of example
    • makes Python display output
  34. script
    program stored in a file used for later interpretation
  35. source code
    program in high-level language before it is converted/compiled
  36. token
    • basic syntax element of program
    • like a word is for human language
  37. float
    output where integer comes with decimal
  38. string
    output with words in quotations
  39. division functions
    • example//example gives integer with no decimal
    • example%example gives just remainder of long division results
  40. input function
    variable = input("example") gives output with example as a string that when answered in shell then defines the variable
  41. true/false function
    • when having two variables defined, can test if those two variables equal with:
    • variable1==variable2 gives output either true or false
  42. type function
    • classifies input
    • type (example):
    • if example is integer, output is <class 'int'>
    • if example is integer with decimal place, output is <class 'float'>
    • if example is integer in quotations, output is <class 'str'>
  43. Engineering Problem Solving Process
    • I. Understand the problem
    • II. Design the Solution
    • III. Implementation (code)
    • IV. Test Plan
  44. iteration
    • one full repetition of an action in a loop
    • aka a pass
  45. Loop
    control statement in code that has repeated statements
  46. definite iteration
    predefined number of repetitions for an action (for loop)
  47. indefinite iteration
    • repetition of action that only stops when it determines it needs to (reaches found limit)
    • (while loop)
  48. For Loop
    • for variable in range(integer):
    •              action 1
    •              action 2
  49. Loop Header
    • first line of code requiring integer range, determining number of loops
    • colon ends header
    • loop body tabbed below header
  50. Loop Body
    • indented and aligned section below loop header consisting of statements/actions
    • actions completed sequentially in body, reaches bottom and repeats
  51. Functions
    • chunks of code defined with name and specific action
    • can be called by name
    • often require "arguments"
  52. Arguments
    • specific data values that place control or limitations on function
    • aka parameters
  53. Module
    • libraries of Python definitions and statements that can provide functions
    • ex. Math Module can be imported (import math) to provide a limited number of math operations that can be used as functions
  54. Returning a Value
    Property of a function, where after the function completes its task(s), it will send the result to to another part of the program
  55. Function Syntax (code)
    • def Variable (parameters *can be left empty*):
    •            statements
    •            return variable *sends variable result somewhere else"
    • to "call" function to be used after it is defined, type: Variable (parameters) or Variable()
    • parameters when defining code are usually variables used in the below statements
    • when calling the function, the parameters are usually integer values that define each set variable to have numerical calculations
  56. Randomize function
    • import module with randomizing function
    • then import function

    • import random
    • random.choice(variable)

    will choose randomly if variable contains multiple values
  57. Functions as Modules
    Placing functions in directory/file to be pulled from or used later, allowing for scripts to be separated out and such
  58. Module Use (after importing)
    to use these functions, type name of module then a dot then the specific functionmath.pi gives the mathematical value of pimath.sqrt(integer) gives the square root
  59. Use Saved Modules
    • After creating script with desired functions in it, save script
    • Import this script title into the interpreter
    • Select functions within script by:
    • import filename
    • filename.functionname(parameters)

    • parameters can be set after importing
    • can set function with new variable name in code
    • variable = filename.functionname
    • variable(parameters) will give same result as above
  60. String Structure
    Strings have data structures that can be broken down
  61. String Length
    Number of characters within string (0-infinity)
  62. Length Function
    • Gives number of characters within given string
    • len("String") would give value of 6, since it has 6 characters
  63. Immutable Data Structure
    • Can isolate data within the element but cannot modify it
    • ex. a string
  64. Upper Case Function
    • Example of string operation
    • Capitalize string function
    • variable = string
    • variable.upper()
  65. Common String Operations
    lower case, capitalize and swapcase
  66. Isolate String Character
    • variable = string
    • variable[n] 
    • gives (n-1)th character in string, because python starts counting at 0
  67. Lists and Isolating Strings
    • A variable can be set to multiple strings, and strings can be isolated like characters, from the strings characters can be isolated
    • variable = string1, string2, etc
    • variable[n]
    • variable[n][z]
    • first gives nth string in list
    • then gives zth character in nth string in list
  68. Boolean value
    True or false. Either satisfies the condition or it doesn't.
  69. Bool Operators (six)
    • Produce True statements:
    • == if two are equal
    • != if two are not equal
    • > if greater than
    • < if less than
    • >= if greater than or equal to
    • <= if less than or equal to
  70. Logical Operators
    • And, Or, and Not
    • Self explanatory meaning
  71. Conditional Execution
    • if, else statements 
    • Boolean expression comes after if statement, called the condition
    • if the condition is true, all statements under the if header are executed
    • else, if the condition is not true, all statements under the else header are executed
  72. Chained Conditionals
    • If multiple possibilities need to be counted for with thus multiple statement sets, intermediate used is elif
    • if x>y:
    • elif x<y:
    • else:
  73. Nested Conditional
    placing one conditional inside of another one
  74. "Turtle" Graphics
    • allows one to draw in created window
    • need to import module: import turtle
    • need to create window:  window=Turtle.screen()
    • and need to create "pen":
    • penname = turtle.Turtle()
  75. module
    a file stored into python with a given definition that can be used an another script after they are imported
  76. data structure
    • compound unit made of smaller pieces of data
    • i.e. a string
    • also called compound data types
  77. immutable data
    data that cannot be modified
  78. slice
    to isolate a subsection of a string or list, create a slice by indexing them with [start:end] but excludes the last number
  79. in and not in operators
    these produce boolean values based on whether or not "string" in "string" is true or false
  80. Find Operator
    • it searches for a character in the string and reports the index where the character is located using a for or while loop after defining the function
    • if it can't find the character it reports back a -1
Card Set
CS 1301 Vocab
CS 1301 Vocab