Concepts you should know

What's an algorithm?

What's big Oh?

Warm Up

Write in pseudocode (see example below) an algorithm for finding the
minimum of 5 variables, call them a1,a2,a3,a4,a5. You can
assume that these variables are given to you. Below is an example of
pseudocode for a function. What do you think this function does?
lecQuizSum = sum of lecQuiz1, lecQuiz2, ... , lecQuiz13
recQuizSum = sum of recQuiz1, recQuiz2, ... , recQuiz6 // might be 7, check later
labSum = sum of labGrade1, labGrade2, ... , labGrade5
examSum = examScore1
projSum = proj1

myPercent = 40% * projSum + 15% * labSum + 40% * examSum +
5% * (lecQuizSum + recQuizSum)
if myPercent greater than or equal to 90
display "Yay, I got an A"
if myPercent greater than or equal to 80 and less than or equal to 89
display "B is okay, I'd like an A though"
if myPercent greater than or equal to 70 and less than or equal to 79
display "C is not too good, better study much harder"
if myPercent greater than or equal to 60 and less than or equal to 69
display "I'm getting a D, should get some help from TAs and professor"
if myPercent below 60
display "F... yeah, I guess I'm retaking CS177"

Computer Science

Create a schematic of an expert system computer program that will
help future computer science freshmen decide what aspect of computer
science is most interesting for them. You may use words or diagrams.
An example of word based expert system is:
Rule 1 -- If you like math, go to Rule 7.
Rule 2 -- If you like writing fiction, try being a writer.
Rule 3 -- Forestry might be for you END
...
Rule 7 -- If you like logic puzzles, go to Rule 24, otherwise go to rule 2.
...
Rule 24 -- If you like programming, software engineering might be for you END
Rule 25 -- Theory might be for you
An example of a schematic for the above (also known as a state
machine) is:

Some helpful information:

A challenge for next time

From an interview with Google (not mine): Suppose you were
shrunk to the size of a nickel. Your mass was shrunk as well,
so your density is the same. You are thrown into a blender,
the blades are about to start spinning; what do you do?

From an interview with Microsoft (not mine): Suppose you're
locked in a building and can't leave. How many ways can you
think of to measure the exterior temperature?