Sei sulla pagina 1di 5

Page 1 of 5

B.E / B.Tech./B.Arch. PRACTICAL END SEMESTER EXAMINATIONS, APRIL / MAY 2019


Fourth Semester

CS8383 & OBJECT ORIENTED PROGRAMMING LABORATORY

(Regulations 2017)

Time : 3 Hours Answer any one Question Max. Marks 100

Aim & Algorithm Program Results Viva-Voce Record Total


20 40 20 10 10 100

1. a. Write a Java program to generate the phone bill. Create a class with the following members:
Consumer Number, Consumer Name, and Number of calls. Generate the bill using the
following rules
1. Upto 99 calls – Rs.50
2. 100 to 199 calls – 50 paise per call
3. 200 to 299 calls – 75 paise per call
4. Above 300 calls – Re 1 per call

b. Write a Java program to find the maximum value from the given type of elements using a generic
function
2. a. Prepare a Vehicle Parking Invoice with Entry time, Exit time, and type of vehicle, vehicle
number and fee amount. For Calculating fee amount
 For Bikes,
 First 6 hours – Rs. 15/-
 Greater than 6 hours – Rs. 2/- per hour
 For Cars,
 First 6 hours – Rs. 25/-
 Greater than 6 hours – Rs.5/- per hour
b. Write a java program to implement user defined exception handling.

3. a. Develop a Java Application to implement Temperature conversion Fahrenheit to Celsius,


Fahrenheit to Kelvin, Celsius to Kelvin and vice versa using packages.
 Fahrenheit to Celsius => C = (F-32)*5/9
 Celsius to Kelvin => K= C + 273.15

b. Write a Java program that reads a file name from the user, displays information about
whether the file exists, whether the file is readable or writeable, the type of file and the
length of the file in bytes.
4. a. Develop a Java Application with Vehicle Class with vehicle type, vehicle number, engine
number, chassis number as member. Inherit the classes bicycle, car, bike, and lorry from
vehicle class. Add top speed, number of passenger, number of gears for Passenger
vehicle, and if is not a passenger vehicle, add total amount of load to carry to the
Page 2 of 5

respective inherited classes. Generate a report for the vehicles.

b. Design a calculator using event driven programming paradigm of Java with the following options
1. Decimal Manipulations 2. Scientific Manipulations

5. a. Design a Java Interface for ADT List. Implement this interface using array.

b. Develop a Java application to generate electricity bill. Create a class with the following members:
Consumer no Consumer name, previous month reading, current month reading, type of EB
connection(i.e. domestic or commercial). Compute the bill amount using the following tariff.
If the type of the EB connection is domestic, Calculate the amount to be paid as follows
First 100 units – Rs. 1 per unit
101-200 units – Rs. 2.50 per unit
201.500 Its – Rs. 4 per unit
>501 units – Rs. 6 per unit
If the type of the EB connection is commercial, Calculate the amount to be paid as follows
First 100 units – Rs. 2 per unit
101-200 units – Rs. 4.50 per unit
201.500 its – Rs. 6 per unit
>501 units – Rs. 7 Per unit

6. a. Write a java program to create an abstract class “bike” which contains accelerate() and
brake() as abstract method and extend this “bike” abstract class in sports bike class and
economy bike class.

b. Design a java interface for ADT stack. Implement this interface using array.

7. a. Write a program to perform add, insert, delete, search and list all book using ArrayList.
Book is an instance of a class with members Book Name, Author Name, Publisher Name.

c. Develop a Java application to implement currency converter (Dollar to INR, Euro to INR
Yen to INR and vice versa), distance converter(meter to KM, miles to KM, and vice
versa) using packages.

8. a. Create a Java Application to calculate GPA for 5 subjects using the marks of the subject
and credits of the subject and implement a user defined exception for subject mark,
credits, subject name, and subject code.
 Subject mark should range between 0 to 100
 Credits should range between 2 to 10

b. Write a program to perform string operations using ArrayList. Write functions for the
following a. Append – add at end b. Insert – add at particular index
c. Search d. List all string starts with given letter.
Page 3 of 5

9. a. Write a java program to create a file for Library Check Log which contains check in and
checkout of users. Use file append operation in Java to create a new log in the log file.
b. Write a java program to create an abstract class named Shape that contains two integers
and an empty method name print Area( ). 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 print Area( ) that prints the area of the given shape.

10. a. Write a java program that implements a multi-threaded application that has two threads.
Both threads generate a random number from 1 to 5 and assign it to a static member, if
both threads generate a same number then stop both threads.
b. Design a java interface for ADT stack. Implement this interface using array. Provide necessary
exception handling in both the implementations.

11. a. Write a Java program to find the sum value of two given type of elements using a generic
function.
b. Develop a Java application to implement distance converter(meter to KM, miles to KM,
and vice versa) time converter (hours to minutes , seconds and vice versa) using
packages.

12. a. Design a GUI java program using event-driven programming paradigm to validate PAN
Card number and Mobile Number.
 PAN Card – start with 5 alphabets, then contains 4 numbers and ends with an
alphabet
 Mobile Number – contains 10 digit number and start with 6 or 7 or 8 or 9.

b. Write a java program to implement user defined exception handling.

13. a. Design a Java Interface for ADT Queue. Implement this interface using Linked List.
b. Write a java program that implements a multi threaded application that has three threads. First
thread generates random integer every 1 second and if the value is even, second thread
computes the square of the number and if the value is odd, the third thread will print the value
of cube of the number.

14. a. Write a Java program to generate the phone bill. Create a class with the following members:
Consumer Number, Consumer Name, and Number of calls. Generate the bill using the
following rules
1. Upto 99 calls – Rs.50
2. 100 to 199 calls – 50 paise per call
3. 200 to 299 calls – 75 paise per call
4. Above 300 calls – Re 1 per call.

b.Write a Java program to find the maximum value from the given type of elements using a generic
function.
Page 4 of 5

15. a. Develop a Java Application to implement Temperature conversion Fahrenheit to Celsius,


Fahrenheit to Kelvin, Celsius to Kelvin and vice versa using packages.
 Fahrenheit to Celsius => C = (F-32)*5/9
 Celsius to Kelvin => K= C + 273.15

c. Design a calculator using event driven programming paradigm of Java with the following options
1. Decimal Manipulations 2. Scientific Manipulations

16. a. Develop a Java Application with Vehicle Class with vehicle type, vehicle number, engine
number, chassis number as member. Inherit the classes bicycle, car, bike, and lorry from
vehicle class. Add top speed, number of passenger, number of gears for Passenger
vehicle, and if is not a passenger vehicle, add total amount of load to carry to the
respective inherited classes. Generate a report for the vehicles.

b. Write a Java program that reads a file name from the user, displays information about
whether the file exists, whether the file is readable or writeable, the type of file and the
length of the file in bytes.

17. a. Write a java program to create an abstract class “bike” which contains accelerate() and
brake() as abstract method and extend this “bike” abstract class in sports bike class and
economy bike class.
b. Write a java program that implements a multi threaded application that has three threads.
First thread generates random integer every 1 second and if the value is even, second
Thread computes the square of the number and if the value is odd, the third thread will
print the value of cube of the number.

18. a. Write a java program to create a file for Library Check Log which contains check in and
checkout of users. Use file append operation in Java to create a new log in the log file.
b. Write a program to perform string operations using ArrayList. Write functions for the
following a. Append – add at end b. Insert – add at particular index c. Search d. List all
string starts with given letter.

19. a. Write a Java program to find the sum value of two given type of elements using a generic
function.
b. Write a java program to create an abstract class named Shape that contains two integers
and an empty method name print Area( ). 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 print Area( ) that prints the area of the given shape.

20. a. Create a Java Application to calculate GPA for 5 subjects using the marks of the subject
and credits of the subject and implement a user defined exception for subject mark,
credits, subject name, and subject code.
 Subject name should not exceed 32 characters
 Subject code should start with two Alphabets and should ends with 4 numbers.

b. Develop a Java application to implement currency converter (Dollar to INR, Euro to INR
Page 5 of 5

Yen to INR and vice versa), distance converter(meter to KM, miles to KM, and vice
versa) using packages.

Potrebbero piacerti anche