December 2001
CS-74: INTRODUCTION OF INTERNET PROGRAMMING
Time: 3 hours Maximum Marks: 75
Note: Question 1 is compulsory. Attempt any three from the rest.
1. (i) Describe Unicode and ASCII code. [05]
(ii) Java is object oriented. What are the advantages of object-oriented programming compared to procedural oriented programming? [05]
(iii) Write a recursive program in Java for the greatest common divisor (GCD). Given two positive integer that divides them both. [10]
(iv) What is the need if a layout manager? Describe flow layout. How do you create a flow layout manager? How do you add a component to a flow-layout container? Is the number of components to be added to a flow-layout container limited? [10]
2. Differentiate between the following: [15]
(a) Methods overloading and overriding a method.
(b) Constructors and methods
(c) This and super
(d) Private and Protected
(e) Extends and interface
3. Define the following terms and what is their purpose: [15]
(i) Panel
(ii) Frame
(iii) Java is distributed
(iv) Java is robust
(v) Java is interpreted
4. Answer the following questions: [04]
(1) Describe the relationship between an object and its defining class, How do you declare a class? How do you declare an object? How do you declare and create an object in statement? [04]
(2) Describe pass by references and pass by value through example. [02]
(3) List the modifiers and describe their purposes. [05]
(4) Determine true or false in the following statements: [04]
(1) You can add a component to a button
(2) You can add a frame to a panel
(3) You can add a button to a frame
(4) You can add a panel to a frame
5. (i) Implement a class employee. An employee a has a name (c string) and a salary (a double). Write a default constructor and constructor with two parameters (name and salary) and two methods: [10]
5. (i) Implement a class student. A student has a name and stipend (double data type). Write a dafault constructor and constructor with parameters (name and stipend) and two methods:
(ii) Answer the following questions: [05]
(a) How do you create a text area with 10 rows and 20 columns? How do you insert 2 lines into the text area?
(b) How do you create a checkbox group with three items? How do you determine if a box is checked?
6. (i) Draw the AWT class hierarchy and discuss important classes and its methods. [10]
(ii) Why do we need to use the layout manager? [05]