CS393 Compiler Design

advertisement
CS131 Introduction to Computer Science I
Final Overview
 You can find summaries of each Lesson at
http://www.dickinson.edu/~cs131/summaries.html
 In addition, the solutions are provided for the odd-numbered exercises for the
Lessons (go to the individual lesson link and at the bottom of the lesson page you
will find a link to the solutions).
 Also look at your notes and the handout from the week we spent reviewing.
 The exam will be worth 200 points (20% of your final grade).
 The exam will weight the topics not covered on previous tests more heavily (i.e.,
strings, How Computers Work, and Project Design). However, a test on
programming is necessarily cumulative. More than half of the material will come
from previous topics.
 A substantial portion of the exam will involve recognizing code and being able to
write code as needed. The exam WILL NOT take place on a computer.
Topic 1 – Intro to CS 131



to what fields is Computer Science most closely related?
when we say Computer Science is the study of computation, what does this
include beyond machinery?
what is programming?
Lesson 1 – HTML and Web Pages




what is the World Wide Web?
what is the Internet?
what is a URL? a Web Browser? a Web Server?
be familiar with the HTML tags discussed in the summary. What are the two
main sections of an HTML document?
Lesson 2 – Algorithms




what is an algorithm?
what is a program?
why is clarity important in algorithms?
which is more precise – a natural language (e.g., English) or a programming
language?
Page 1 of 5
Lesson 3 – Dynamic Web Pages via JavaScript





what HTML tag do you need to use in order to embed a JavaScript program in a
web page?
what is a variable? how do you declare one?
how do you assign a value to one?
how do we display the contents of variables?
what does the prompt function allow us to do?
Topic 2 – COMPUTER BASICS





what is hardware?
what are the three main components of a computer (i.e., what are the parts of the
von Neumann Architecture)?
1. can you give some examples of input and output devices?
2. what is memory?
 what is a byte? a bit?
 how big is a megabyte?
 is main memory (RAM) volatile?
 give an example of a secondary storage device? is secondary
storage volatile?
3. what is the central processing unit (CPU)?
 what are the two parts of a CPU?
recall that Moore’s law states that “processing power doubles every 18 months”
o does the speed of memory increase at the same rate?
o what is cache? why do we need it?
what is software?
o what is an operating system? what are some of the things it does for us?
what happens when we turn on a personal computer?
o what does it mean when we say that our computer has booted up?
Lesson 4 – Data Types and Expressions



what are the three data types in JavaScript?
be able to tell me what the contents of variables are after a set of assignments, that
is, be able to trace through code
what do we have to do to the value returned from the prompt function if we are
going to use it in a math calculation that involves +? what would happen if we
just used the value returned directly with +?
Lesson 5 – Abstraction and Functions

what is a function? why do we call it a unit of computational abstraction?
Page 2 of 5




what is another name for the inputs to a function? what is another name for any
output it may have? can a function have no inputs?
be able to call a function
o in what three ways must the arguments to a call of a function match the
parameters in the function definition?
o know some of the more commonly used Math library functions, such as
Math.sqrt, Math.pow, and Math.max
 how many inputs does each one take? what do the functions do?
know how to use randomInt and randomOneOf from the random.js library
o if I gave you some code calling them, would you know what it does?
o could you write a simple program using one or both to generate a value?
you do not need to know any other function from prompt.js or random.js
o if I ask you to make use of one of them or of a function from another
library, I will tell you what it does and how to call it on the test
Lesson 6 – User-defined Functions




how do we define a function?
how do we return a value from a function?
in what sections of an HTML document can we place functions?
what is a local variable? can we access its value outside of the function in which it
is declared?
Topic 3 -- Internet and the Web


what organization funded the creation of the forerunner of the internet? what was
the internet originally called?
what is the difference between a packet-switched network and a circuitswitched network? can you give an example of each type?
Topic 4 -- History of Computers









who developed one of the first mechanical devices to do addition?
what was the first device that could be programmed with punched cards?
who was Charles Babbage? why is Lady Augusta Ada Byron often considered
the first programmer?
what did Herman Hollerith have to do with the 1890 census?
what machine did Alan Turing develop? what was it used for?
what are two of John von Neumann’s contributions to computing?
what has been described as “the most important invention of the 20th century?”
what were some of the advantages of this device over previous technologies?
what is an integrated circuit? what is VLSI?
what is a microprocessor? what company developed the first microprocessor?
what company popularized the term “personal computer?”
Page 3 of 5

what company did Steve Jobs and Steve Wozniak found? what company did Paul
Allen and Bill Gates found?
Lesson 7 – Event-driven Programming




how do we create an HTML button? a text box? a text area?
what does a VALUE attribute do? why do we need NAMEs for forms and
HTML elements such as text boxes?
what does the ONCLICK attribute of a button allow us to do? what about the
ONCHANGE property of a text box?
how do we get the value of a text box/text area in JavaScript? how do we assign a
value to a text box/text area? what is the type of data stored in these variables by
default? what do we have to do if we need to use the values of these variables as
numbers?
Lesson 8 – Conditional Execution





what are conditional expressions?
know the relational operators in JavaScript (e.g, ==, !=, <=)
what are the three basic control-flow constructs in JavaScript?
know how to write and read IF statements (along with IF-ELSE’s and Cascading
IFs)
you do not have to know the input verification functions in verify.js
Lesson 9 – Dynamic Images




how do we place an image into a Web page using HTML – know the IMG tag and
what SRC means?
how can we access the SRC attribute of an image from Javascript? (how did we
change each die image as we rolled them?)
know what the AND (&&), OR (||), and NOT (!) Boolean operators do as well
how do we create Boolean expressions using a combination of Boolean operators
and relational expressions?
Lesson 10 – Conditional Repetition





be able to write and read a while loop
what is the body of a loop? under what condition does the loop keep going?
when does it stop?
be able to trace through the execution of a loop
what is an infinite loop?
you will not have to use the pause.js library
Lesson 11 – Counters and Repetition
Page 4 of 5





what is a counter? a counter-driven loop?
what are the three components of a counter-driven loop?
know how to write and read a for loop
what do the three parts of the for loop header do?
when do we use a for loop vs. when do we use a while loop?
Lesson 12 – Strings and Objects



What are objects? What do they include?
What properties/attributes do strings have (e.g., how do we get a string’s length)?
What operations can we perform on strings …
o returning a copy of a string in upper or lower case – toUpperCase and
toLowerCase
o getting a character at a particular position a string – charAt
 what is the index of the first character in a string?
 what is the index of the last character in a string?
o retrieving a substring of a string – substring
o getting the position of a character in a string – indexOf
Topic 6 -- HOW COMPUTERS WORK, PT. 1





what is the von Neumann Architecture? what are its components?
what are the two parts of a CPU? what are registers?
what do we mean by the clock speed of a processor? what is does the word size of
a computer refer to?
what is a bus used for in a computer?
what is the difference between sequential access and random access memory?
what is the difference between read/write and read only memory?
Tutorial – THE KNOB & SWITCH COMPUTER




what is a low-level language? what is machine language?
what is assembly language?
what is a high level language? give an example
you do not need to know the Knob and Switch machine or assembly languages
from memory
PROJECT DESIGN




know the Program Development Life Cycle (6 steps)
what is pseudocode?
what is top-down design?
what are the advantages of a good design?
Page 5 of 5
Download