CSE15: Introduction to Computer Science
Final Exam sample questions
(based on chapters 4-10 of The Universal Computer and A Multimedia
Introduction to C++)
Answer the following T or
F. Explain why or why not. (3 each, 45 total)
The Universal Computer
has chapter review questions at the end of each chapter. Study these, then
see answers at http://www.cse.lehigh.edu/~glennb/um/book/exsolnew.htm.
Write a function prototype for a function that returns an Lstring, takes one float parameter by value, one Note parameter by reference and one StringArray parameter by const reference.
What is an advantage of value
parameters? What are two
advantages of reference parameters?
Write a function which, given an Lstring, converts all the periods into commas and returns the new Lstring. Note: do not use any library functions, just the subscript operator.
Consider the following snippet
from the atm_oop program:
class Account {
public:
Account();
int getPIN() const;
void setPIN(int PIN);
private:
int PIN; //Personal Identification Number
};
a) Define a variable, myAccount, of this type, then assign it a PIN.
b) Why is the following snippet
illegal? Why is making it illegal a good idea?
if (myAccount.PIN
== 2468)
c) Implement member function setPIN,
using the scope operator.
How do classes illustrate
abstraction?
Write a use case
describing the behavior of the Move button in Knobby’s World.
a)
Batch operating systems
Which is more secure, a Caesar cipher encryption or a public-key encryption scheme? Why?
Under what conditions
should we sort an array before searching it?
If chess-playing is an
exponential problem, and people are relatively slow to consider the consequences
of possible moves, why are some people good chess players? Why only recently
did a special-purpose supercomputer defeat the world champion?
In the worst case, is hashing worse, the same, or still better
than linear search? Why?
When should a web designer use JPG rather than GIF and vice versa? Why?
In terms of usability principles, when and why might a rollover effect be a good idea?
What is the frame/second rate of motion pictures? What is the default rate in Flash? Why is there a difference?
Discuss the pros and cons of a national biometric database (give at least one reason for and one against).
In 1998, Congress passed legislation keeping Internet commerce tax-free. But many states are looking forward to the sunset of these provisions so that they can get income from e-commerce. Should e-commerce remain tax-free? Why or why not?
Which is more like depth-first search—best-first or hill-climbing? Which is more like breadth-first search?
Why would a speech recognition program have difficulty telling
the difference between the sentences “He stops at the store” and “His top’s
at this door”? How do you think humans manage to tell the difference?
If you had an EMYCIN-based (backward chaining) shell, a forward
chaining shell, a frame-based shell, a case-based reasoner, and a back propagation
neural network tool, which would you choose for simulating the following experts,
and why?
a) An operator monitoring sensors on a nuclear reactor.
b) A hand writing expert.
c) A civil engineer designing bridges.
d) A mechanic troubleshooting Toyotas.
e) A help desk helping with problems with a company's line of printers.
Th.. th.. th.. that's all folks!