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. (The final may include some of these questions or similar ones.)

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? How does class inheritance further illustrate abstraction?

 

Write a use case describing the behavior of the Move button in Knobby’s World.

In the UML diagram for Knobby's World, what does the attribute InstructionPointer in class Interpreter represent? What does operation step() do with this attribute?

What is pair programming? What commitments do students need to make for pair programming to work well?

What two objects does Knobby’s world have that are essentially equivalent to the accumulator and a register, respectively?

What Knobby instructions are analogous to STO and RCL?

Write an RM program fragment which reads an input value and stores it in register 2 if the accumulator value is zero, but recalls the value from register 5 and outputs it if the value is non-zero.

Write a truth table for xor (exclusive or).

What is the purpose of virtual memory? If a program tries to access an address that is not in main memory, what happens?

Explain why multiprogramming can improve the performance or "throughput" of each of the following types of systems:

a) Batch operating systems b) Time-sharing operating systems

What is a process? What can happen if two processes compete for the same resources?

What are some resources (name at least three) that servers provide clients via a network?

What are packets on the Internet? Describe the kind of information that at least one or two different layers of the OSI network model add to each packet.

What does the Caesar cipher produce from the plain text “HELLOWORLD” if j is 4?

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!