CSC 121: Computers and Scientific Thinking
Fall 2020

Test 2 Review


Mon, Oct 19
9:30 - 10:30 (CDT)
  • The test will be conducted remotely via Blueline.
  • It is closed-book, closed-notes, and you will be required to have a camera on during the test.
  • It will contain 50 points, so 1.2 minutes per point.
  • Similar to Test 1, it will include a variety of questions (e.g., TRUE/FALSE, multiple choice, short answer, trace/modify code).
Study advice
  • review book chapters & online lecture notes
  • look over chapter exercises, review questions, projects & labs
  • reference other sources for examples, different perspectives
Course Material
TEST 1 MATERIAL

History of Computers
   generation 0: mechanical
       Jacquard's loom, Babbage's analytical engine, electromagnetic relay
   generation 1: vacuum tube 
       COLOSSUS, ENIAC, von Neumann architecture
   generation 2: transistor
       miniaturization and mass production, high-level programming languages
   generation 3: integrated circuit (IC)
       mass production of complex circuitry, operating systems
   generation 4: microprocessor 
       mass-produced calculators, Moore's Law, PC revolution
   generation 5: ultra large-scale integration (ULSI)
       multi-core & parallel processing, wi-fi & wireless, AI applications
Scientific & Computational Thinking
   history of science
       Greek pre-science, Islamic empire, Dark Ages, Renaissance, Scientific Revolution
   scientific method: observe, hypothesize, design, experiment, analyze
       experimentation, reproducability, consistency vs. accuracy
   computational thinking
       decomposition, pattern matching, abstraction, algorithms
       examples: algorithms for finding oldest person (simple vs. efficient)
Algorithms & Programming
    Polya's problem solving steps
    algorithm analysis, rate of growth, Big Oh notation
        examples: sequential search vs. binary search, Newton's algorithm
    machine language vs. high-level language
        program translation: interpreter vs. compiler
Computer Science as a Discipline
    study of computation, artificial vs. natural science
    CS themes: hardware, software, theory
    subfields of CS
        Algorithms & Data Structures: public-key encryption
        Architecture: parallel processing, multicores
        Operating Systems & Networks: Ethernet, WiFi
        Artificial Intelligence: Turing Test, neural networks
    related fields
        Bioinformatics: tools, modeling, information storage/retrieval
        Data Science: supervised vs. unsupervised learning
    ethics of computing
    
Experimental methods
    Monte Carlo methods, simulations
    Law of Large Numbers
    consistency vs. accuracy

Dynamic Web Pages
    dynamic HTML elements
        ID attribute, JavaScript assignment (ID.ATTR = VALUE;)
        event-hander attributes: ONMOUSEOVER, ONMOUSEOUT, ONCLICK
        JavaScript strings (' ') vs. HTML strings (" ") 
        example: image that resizes on mouseover/mouseout
    HTML buttons
        BUTTON tag, ONCLICK attribute, button label between <button></button>
        example: click buttons to select image in photo gallery
    dynamic text
        alert statement vs. embedded text
        innerHTML attribute of DIV, P and SPAN elements
        example: dynamic caption in photo gallery
    dynamic style, e.g., colorSpan.style.color = 'red';
Interaction & Design
    text boxes
        INPUT tag, ID and style="text" attribute, optional SIZE & VALUE attributes
        examples: form letter, fill-in-the-blank story
    design guidelines
    user-defined functions
        used to simplify the BODY, move action code to the HEAD (in a SCRIPT element)
        function definition: function FUNC_NAME() { ... }
        function call: FUNC_NAME();
        examples: simplified version of form letter, quotations page
Numbers & Computation
    JavaScript data types: strings, numbers, Booleans
    numbers & expressions
        mathematical operators (+, -, *, /), parseFloat function
        variables to store number values and temporary calculations
        number representation:  scientific notation, rounding
        examples: tip calculator, grade calculator
    embedded counters
        used to count how often an event (e.g., mouse click) occurs
        initialize a span to contain 0, access&increment&replace the span contents
    predefined functions
        Math.sqrt, Math.abs, Math.floor, Math.ceil, Math.round
        Math.min, Math.max, Math.pow
        examples: bit values, pick4 lottery
    programming errors & debugging
        syntax error, run-time error, logic error       
Randomness & libraries            
    can view functions as units of computational abstraction
    Math.random
        no inputs, returns random number from [0...1)
        can multiply to expand range, add to shift range, use Math.floor to get integer
        example: Math.floor(10*Math.random()+1) evaluates to random integer from 1 to 10
    fully-functional functions
      parameters, return statement
      common use: for general-purpose computations
      examples: simplified pick4 page, distance page
    function libraries
      SCRIPT tag with SRC attribute to specify library file name
      common use: for collections of functions that may be reused
      random.js library 
        RandomNum, RandomInt, RandomChar, RandomOneOf library functions
        examples: dice, random sequence generator, Oracle of Internet