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

Cie 1 Java 2021

This document contains instructions for a programming exam with 5 questions. Each question has two parts - an understanding part worth 2 marks and an application part worth 3 marks. Question 1 covers inheritance in Java with examples. Question 2 discusses control flow statements and conditional statements with a program to guess a random number. Question 3 is about packages and importing with a program using inheritance between classes that both have a color property. Question 4 is about abstract classes with a program creating shapes. Question 5 is about exception handling with programs demonstrating try, catch, and finally as well as handling division by zero.

Uploaded by

Chetan vision40
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Cie 1 Java 2021

This document contains instructions for a programming exam with 5 questions. Each question has two parts - an understanding part worth 2 marks and an application part worth 3 marks. Question 1 covers inheritance in Java with examples. Question 2 discusses control flow statements and conditional statements with a program to guess a random number. Question 3 is about packages and importing with a program using inheritance between classes that both have a color property. Question 4 is about abstract classes with a program creating shapes. Question 5 is about exception handling with programs demonstrating try, catch, and finally as well as handling division by zero.

Uploaded by

Chetan vision40
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Hall Ticket No Course Code: AITC02

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
B.Tech III SEMESTER CIE - I EXAMINATIONS NOVEMBER - 2021
Regulation: UG-20
PROGRAMMING WITH OBJECTS
Time: 2 Hours (CSE|IT|CSEIT|DS) Max Marks: 20
Answer any FOUR questions
All parts of the question must be answered in one place only

1. (a) What is inheritance? List different types of inheritances supported by java with suitable
examples. [BL: Understand| CO: 4| Marks: 2]
(b) Describe the primitive data types supported in java and write a java program to print first 100
Fibonacci numbers. [BL: Apply| CO: 1| Marks: 3]

2. (a) List out different types of control flow statements. Discuss about various conditional statements
in java with suitable examples. [BL: Understand| CO: 3| Marks: 2]
(b) Write a program that generates a random number and asks the user to guess what the number
is. If the user’s guess is higher than the random number, the program should display ”Too high,
try again.” If the user’s guess is lower than the random number, the program should display ”Too
low, try again.” The program should use a loop that repeats until the user correctly guesses the
random number. [BL: Apply| CO: 1| Marks: 3]

3. (a) Explain package with syntax. Demonstrate how many ways packages can be imported.
[BL: Understand| CO: 5| Marks: 2]
(b) Write a java program for the following scenario, Animal and Dog both classes have a common
property color. If we print color property, it will print the color of current class by default. To
access the parent property, we need to use super keyword. [BL: Apply| CO: 4| Marks: 3]

4. (a) Write about abstract class with its syntax. Illustrate what happens if the parent and the child
class have a field with same identifier. [BL: Understand| CO: 4| Marks: 2]
(b) Write a java program to create an abstract class named Shape that contains two integers and
an empty method named printArea().provide three classes named Rectangle, Triangle and Circle
such that each one of the classes extends the class Shape. Each one of the classes contains only
the method printArea () that prints the area of the given shape.
[BL: Apply| CO: 5| Marks: 3]

5. (a) Describe try, catch, and finally keywords used in exception handling with an example program.
[BL: Understand| CO: 6| Marks: 2]
(b) Write a java program to handle the abnormal termination caused by an arithmetic expression
having division by zero. [BL: Apply| CO: 6| Marks: 3]

−◦◦⃝◦◦−

Page 1 of 1

You might also like