CS 1400 exam 1

59 flashcards · Computer Science · by Elsa Schutfort

  1. How many bits does one byte have?

    8

  2. Computer memory (RAM) is volatile

    true

  3. What does CPU stand for and what is its function?

    Central processing unit , most important piece, processes the data in the computer.

  4. What is an Assembly Language?

    Uses an assembler to convert to machine code. uses a short instruction that can be translated into machine language, and easier than writing in machine language

  5. Complier

    creates a new file to run a code

  6. Three major tasks of an Operating System

    Controlling and monitoring system activities, scheduling operations, allocating and managing system resources

  7. CPU (Match speed to each component)

    Fastest

  8. Memory (Match speed to each component)

    Fast

  9. Storage (Match speed to each component)

    Slow

  10. What language does a CPU understand?

    machine language

  11. Do coding rules need to be followed in order for a program to execute properly on a computer system?

    Yes

  12. Do coding conventions need to be followed in order for a program to execute properly on a computer system?

    No

  13. What type of error prevents a program from running at all?

    Syntax Error

  14. What causes a run-time error?

    Happens when python can't understand what you're saying

  15. What causes a logic error?

    caused by a mistake in the program's logic

  16. What units is used to measure CPU?

    GHz

  17. What language does a CPU understand?

    machine language

  18. What is the end parameter?

    end""

  19. val = input()

    allows val to be assigned a string that is received from a user

  20. val = float(input())

    converts users input into a float

  21. str(a)

    converts values into string form

  22. Step of Software Development Process that is concerned with user's perspective

    Requirements Specification

  23. value //= 2

    changes the value when printing

  24. Proper name for a constant value according to standard naming conventions

    MAX_VAL

  25. Multiple Assignment

    Making more than one assignment to the same variable during the execution of a program (val1 = val2 = 5)

  26. Scope

    the term that defines the rules where a variable/identifier can used (the rule that a variable must be declared/created before it is used is part of this)

  27. modules in python

    they exist inside of libraries and hold extra function (ex. turtle, math, time)

  28. escape sequence to insert a newline in a string

    \n

  29. What is 10 in 10.2f

    width

  30. What is 2 in 10.2f

    the precision

  31. What is f in 10.2f

    float can be a s for string

  32. =+ 10.2f

    adds plug then puts the padding

  33. < 10.2f

    left aligns the results

  34. > 10.2f

    right aligns the result

  35. ^10.2f

    center aligns the results

  36. volatile

    data disappears when power is removed

  37. Interpreted High-Level language

    Python is an example of an

  38. type(a)

    returns the type of data (ex. string, float, int)

  39. -=

    subtracts and assigns

  40. Step of the Software Development Process that is from the developers perspective

    System Design

  41. importing just factorial

    from math import factorial

  42. math.pow(a, b)

    a^b

  43. What is a string literal?

    any text in between a set of quotes

  44. id(a)

    returns the identity of the object

  45. How do you put quotes in a print statement?

    \"[insert]\"

  46. +=

    add and assigns

  47. **

    exponentiation (3 ** 2 = 9)

  48. %

    modulus or remainder operator (5 % 2 =1)

  49. Concatenation

    linking into chains

  50. banking rounding

    round to the nearest even whole number

  51. round(val, number)

    needs to be given a number to round with

  52. Scope issues

    runtime errors if the variable is given after it's used

  53. print("Hello" + "Goodbye")

    HelloGoodbye

  54. print("insert" + val1 + val2)

    Run-time error because val1 and val2 aren't strings

  55. //

    integer division (1/2 = 0)

  56. /

    floating point division

  57. +

    binary addition and unary positive

  58. -

    binary addition and unary negative

  59. *

    binary multiple