0% found this document useful (0 votes)
230 views

Java and Internet Technologies Lab Exam-A2batch

The document contains questions related to Java programming. It asks to: 1) Define classes like Person, Employee and Specialist with methods to display information. Create arrays and display details. 2) Create an XHTML table to display football scores using classes and selectors. 3) Implement event handlers for radio buttons to select airplane details and display chosen color. Write a program to calculate population growth over time. 4) Write programs to calculate area of shapes using interfaces and inheritance. Calculate population growth over time. 5) Create Family class with methods to check relationships. Read and display family details. 6) Write a program to count prime numbers in a given range with exception handling. 7) Write

Uploaded by

Chester Fox
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
230 views

Java and Internet Technologies Lab Exam-A2batch

The document contains questions related to Java programming. It asks to: 1) Define classes like Person, Employee and Specialist with methods to display information. Create arrays and display details. 2) Create an XHTML table to display football scores using classes and selectors. 3) Implement event handlers for radio buttons to select airplane details and display chosen color. Write a program to calculate population growth over time. 4) Write programs to calculate area of shapes using interfaces and inheritance. Calculate population growth over time. 5) Create Family class with methods to check relationships. Read and display family details. 6) Write a program to count prime numbers in a given range with exception handling. 7) Write

Uploaded by

Chester Fox
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Java and Internet Technologies Lab Exam A2 Batch 1.

. a) Define a Person class with three data members age, name and sex. Derive a class called Employee from Person that adds a data member code to store employee code. Derive another class called Specialist from Employee. Add a method to each derived class to display the information about what it is. Write a driver program to generate an array of three ordinary employees and another array of three specialists and display the information about them. Also display the information of the specialists by calling the method inherited from employee class. b) Create an XHTML document that displays a table of football scores from a collegiate football conference in which the team names have one of the primary colors of their respective schools. The winning scores must appear larger and in a different font than the losing scores. Use class and generic selectors. Use ESS. 2. a) Consider a set of radio buttons, labeled red, blue, green, yellow and orange that enables the user to choose information about a specific airplane. Click event is used to trigger a call to alert, which presents a brief description of the selected airplane. Event handlers for these buttons must produce messages stating the chosen favorite color. The event Handler must be implemented as a function, whose name must be assigned to the onclick attribute of the radio button elements. Chosen color must be sent to the event handler as a parameter. b) Population of 2 countries A and B are x and y respectively(x>y). Their growth rates are p and q respectively (q>p). Read the necessary input from the keyboard. Write a Java Program to determine number of years required until the population of B exceeds that of A 3.a) A toll booth at a bridge and car passing by the booth are expected to pay 50 paise, mostly they do, but sometimes a car goes by without paying. The toll booth keeps tracks of the number of cars that have gone by and the total amount of money collected. Write a java program to model this class. b) Write a script that checks the validity of the form values for a name and phone number obtained from text widgets. Name format: lastname, firstname and middlename. 1st and last names must begin with uppercase letters and have atleast one lowercase letter, followed by comma. Middlename must be uppercase, followed by a period or not. Phone format: three digits, dash, three digits, dash and four digits. Use anchor characters, alerts, focus and select.

4. a) Population of 2 countries A and B are x and y respectively(x>y). Their growth rates

are p and q respectively (q>p). Read the necessary input from the keyboard. Write a java Script to determine number of years required until the population of B exceeds that of A. b) Define an interface area which implements the method double compute(double x). Create a class Shape which declares methods computearea() and draw(). Classes Square, Circle and Triangle derive from Shape class. Classes Square and Circle implements the interface method compute() to calculate its area whereas triangle overrides the shape class computearea() method. All the derived classes override draw() method which gives information on the object it is drawing. Write a Java application for the same. 5. a) Create Java class for a Family. Family name (surname) is static and cannot be changed for any members of the family. Names are unique in the family. Establish isSon and isDaughter methods to derive a given person is son/daughter or not. Write a program to read the family member details from the keyboard, display the member in the order of their relationship. b) Create an HTML document with JavaScript for calculating roots of a quadratic equation using window and document objects.

6. a) Write a program that count how many prime numbers between minimum and maximum values provided by user. If minimum value is greater than or equal to maximum value, the program should throw a Invalid Range exception and handle it to display a message to the user on the following format: Invalid range: minimum is greater than or equal to maximum. For example, if the user provided 10 as maximum and 20 as minimum, the message should be: Invalid range: 20 is greater than or equal to 10. b) Create an HTML document with JavaScript. Write a function to return the position of the string of the leftmost vowel. 7.a) Write an applet program that inputs the three floating point numbers from the user and display the sum, avg, largest of three these numbers. b) Create an XHTML document to describe a table with following contents: columns of the table must have the headings: pine, Maple, Oak, Fir. Rows must have the labels Average height, average width, typical lifespan and leaf type. Use data values. Add second level column label Tree and second level row label characteristics. Use rowspan, colspan, align and valign, cellspacing and cellpadding attributes.

You might also like