CS 178 Programming with Multimedia Objects
Fall 2004 |
||||||||||||||
Practice Problems
Prepared by: Aditya Mathur. Exam 1: Sept 22, 2004. 7:8:30pm. Room: EE 270. |
||||||||||||||
Part A: Closed Book. 10 multiple choice questions,. Total: 20 points. Time: allowed: 30 minutes. It will cover material from the textbook: Chapter 1. Chapter 2.1, 2.2. Chapter 3.1, 3.2, 3.3. Chapter 6.1, 6.2, 6.4.
Part B: Open Book. Total: 80 points. Time allowed: 60 minutes.Two questions. Question 1: You will be asked to code a given algorithm into a Java applet. Question 2: You will be shown an applet and its behavior will be described. You will be asked to write code to generate the applet shown. Question 1 will not require any code related to event processing. Question 2 will require you to write code related to event processing. Sample question for Part A: Dog denotes a class. We want to create an object named myDog of type Dog and initialize its name to "Raja". Which of the following Java statements is the correct way of performing this task? (a) myDog=Dog ("Raja"); (b) Dog myDog=new Dog("Raja"); (c) Dog myDog; (d) Dog myDog=new "Raja"; Preparation for Part B: If you can write the code ON YOUR OWN, with help from the textbook, with help from Eclipse, without help from anyone, and without consulting your notes, then you are well prepared for Exam 1. For your your own sake, please do not look at the source code given here until after you have successfullly tried writing the code on your own. |
||||||||||||||
Source (look at it only after you have tried to write the program yourself.) | ||||||||||||||
Source (look at it only after you have tried to write the program yourself.) | ||||||||||||||
Source (look at it only after you have tried to write the program yourself.) | ||||||||||||||
Source (look at it only after you have tried to write the program yourself.) | ||||||||||||||
The next applet requires conversion of integer data to strings. Check out the Lecture slides here to find out how to convert an integer to an equivalent String and update a TextField. | ||||||||||||||
Source (look at it only after you have tried to write the program yourself.) | ||||||||||||||