Look at and become familiar with the exam instructions.
exam instructions for class exams
and the final examination.
Exam questions can be based on the following sources: (1) on-line web sites, (3)
classes, (4) reports, (5) exercises, and (6) course web pages. They are
based on topics from the beginning of the year up to and including the class
before the exam, although more recent topics will be emphasized in later exams.
Consider all concepts and terminology used in on-line web sites, reports,
and classes and ask the typical questions - how, why, when, where and
what -- individually and in combination. In particular, variations are based
on "describe", "explain", "define", "what is meant by", etc. you may be asked to
do variations of some of the programming exercises.
Javascript programming questions
All these and similar questions an be answered by thinking about the items
in the Javascript topics page and the example programs discussed in class.
Given a script determine what it does.
Given a partial script fill in the blanks to accomplish the specified
task.
Given one or more functions describe what they do. For example, what
would be written to a web page?
Given an function written with if..else statements, write a
corresponding program with a switch statement, and vice-versa.
Given a function written with one of the looping structures, write
the algorithm using one of the other looping structures.
Describe the two types of choice-control structure in Javascript.
When do you choose one type over the other; i.e. what are their
respective advantages and disadvantages.
Describe the four types of loop-control structures in Javascript.
When do you choose one type of loop structure over the others; i.e. what
are their respective advantages and disadvantages.
Describe the how to handle errors with the try-catch-throw statements.
Describe the three types of control structure used in programming in
any language.
Describe the sources of errors in a program.
Describe the types of error provided by Javascript.
Write short functions that have parameters and return a result.
What is an object literal and how is it used?
Examples of functions that you could be asked to write
All of these and other functions can be written with the concepts shown on
the Javascript topics page and the example programs we have discussed in class.
Return the maximum of three numbers, or the maximum of the three numbers
could be written to the web page. For example:
var max = max_of_three(2, 30, -5)
// The value of max would be 30)
Reverse the items in an array or list. For example:
var a1 = [1, 2, 3, 4, 5];
var a2 = reverse(a1):
// The value of a2 would be [5, 4, 3, 2, 1]. And
var a3 = reverse(a2); // has the value [1, 2, 3, 4, 5]
Find the maximum numberin a list of numbers.
Find the length of each string a list of strings.
Find the sum of the numbers in a list, where the list could contain both numbers and non-numbers. For example in the list [1, “a”, “b, 2, true, 3] the sum of the numbers is 6.
Given a list of arbitrary items. Count the number of stings or numbers or Booleans the list contains. There are many criteria that could be used for counting: how many are negative numbers; how many numbers are bigger than 100; how many strings contain the letter ‘A’ and are of length less than 5.
Given two lists of numbers, do the lists have the same numbers in the
same order?
// r1 is true.
var r1 = same_numbers( [1, 2, 3, 4, 5], [1, 2, 3, 4, 5])
// r2 is false.
var r2 = same_numbers([1, 2 ,3, 4, 5], [1, 2, 3, 5, 4])