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. The class
detail on exam days gives the topics for that exam.
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 will be asked to
do variations of some of the exercises done in class and in reports.
JavaScript generic questions
All these and similar questions can 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 a while loop, write
the algorithm a do..until loop, and vice-versa.
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 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.
What is an object literal and how is it used?
JavaScript 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.
You have to write the algorithm; you cannot use a built-in function that
does the task.
Return the maximum of three numbers. 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 number a list of numbers.
Find the length of each string a in list with different types of items.
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 strings 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])