0% found this document useful (1 vote)
53 views7 pages

Oops Question Paper

Uploaded by

Bagath Tony
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (1 vote)
53 views7 pages

Oops Question Paper

Uploaded by

Bagath Tony
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
Page 2 of 2 | Witte a Java Program to create an abstract class named Shape that contains (wo integers an ‘an empty method named printArea(). Provide three classes named Rectangle, Triangle and Girele 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 saps avelop a java program for employee salary calculation using mull level, Inheritance 6 el a ae enh el “V-fo write a Java program that reads a file name from the user, displays information about whether 7, | Toile exists, whether the File is readable, or writable, the type of file and the length of the file | in bytes la Write a java program to find the factorial ofa number using interface concept. — i “To write a java program to find|the maximum value from the given type of elements using {generic function. | Write a java program to insert an element into ‘an array ant mn array using packages ‘Design a calculator using event-driven programming paradigm of Java with Decimal _manipulations pet a & se = Design a Java Mleflace for ADT Stack. Implement this interface using amsy Providl _ necessary exception handling in both the implementations x —— Hite « progam to perforin siriig operations using ArrayList, Write functions for the Following | a. Append — add at end |p. Insert — add at particular index Search 4, Listall siting. starts with given beter emo i V4 | Write a Java program that keeps a number from the user and generates an integer between | and 7 and displays the name of the weekday. | Tesi Data Input number: 3 | Expected Output on Wednesday _ : ava / Write a Java Program to create an abstract class na 15, | addition of two numbers und addition of three numbers 16 | Create a new class which implements java.lang.Runnable i Perform multithreading operation _ a Write a program to Check Prime Number using Interface. 12. moftwo and sumofThree. Perform terface and override ran) method. | + Galsulaie the student grade using interface a 19 | A company advertises various products in its website to scil. Products can be either electronics, | clothes, jewelry, cosinetics, books stationery ,sports items ele, Offer Zone class shows products ‘with discounts, special offers ete, Price, Brand of product should be listed along with category | and name of the product, when user specifies name of product. Implement the above scenario | using java concepts like interface and inheritance (use multilevel inheritance with minimum 4 [revels along with other types of inheritance). _ / Write a Java program to implement user defined exception handling. Display the result for the | following input a=1, b=0 perform c=a/b. 4. een seenenene teen emo ‘Design a Java Interface for ADT Stack. Implement this interface using array. Display the result for the following input 3,4,5,9,77 and print the output. : Wiite a program to perform string operations using Array List. Write functions for the following a, Append — add al end b. Insert = add atindex 2 ©, Search following input a=1, b=0 perform c=alb, Bavelop a Java application to generate Electricity bil, 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. the type of the EB connection is domestic, calculate the amount to be paid as follows: First 150 units — Rs. 1 per unit 11-250 units — Rs. 2.50 per unit 251 -500 units ~ 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 150 units ~ Rs. 2 per unit 161-250 units — Rs. 4.50 per unit 251 -500 units — Rs. 6 per unit > §01 units - Rs. 7 per unit ~) Develop a Java application to Implement currency converter (Dollar to INR, EURO to INR, Yen to INR and vice versa), distance converter (mater to KM, miles to KM and vice versa), time converter (hours to minutes, seconds end vice versa) using packages. | Develop a java application with Employee class with Emp_name, Emp_id, Address, Mail_ic, Mobile_no as members. Inherit the classes, Programmer, Assistant Professor, Associate >rofessor from employee class. Add Basic Pay (BP) as the member of all the Page 2 of 2 5 with 07% Of BP a8 DA, 10% of BP as HRA, 12% of BP ae PF, 0.1% of BP for inherited classe aft lub fund, Generate pay slips for the employoos with thoir gross and net salary. Write @ Java Program to ereato an abstract class named sumOftwo and sum of Three: id addition of three numbers. Perform addition of two numbers an user, displays Information about whether yinto 6 Java program that reads a file name from the the tyne of file and the length of tho fila in tho le existe, whether the fil is readable, or writable, bytes. Create a new class whieh Implements java lang. Perform multithreading operation, Design a calculator using event-driven programming paradi manipulations. Runnable interface and override run() motho gm of Java with Decimal | 1 | | 4 1. | Watee ‘program to Check Prime N! iq, | Owates program to display Fibonacel series using recursion ae i | (i) Write a Java Program to ‘Check a Leap Year using inheritance concept. ara ee FaaT To Td o mnTmu value, fom The gwen pe ot Terenis sing @ 43 | genenc function i ‘Write @ Java program that prints numbers from 1 {0 10 line by lino alter every § seconds. 745 _ | Develop the intemal mark calouation sysior) based on the ationdance percentage using Java. Get the student name, register number, total number ‘of working days in the semester and Ce i seers present, Calculate altendance percentage of the students and award attendance mark based on the following condition. ‘Atlendance percentage >=90 ~ 5 Marks Attendance percentage >=80 and < 90 ~ 4 Marks Atiendance percentage >=75. and < 80 - 3 Marks ‘Attendance percentage <7 - 0 Marks 76 | Wite: a Java’ program for implementing producer consumer problem using Inter-thread ‘communication 7 | Write 2 Java programs one implementing Arithmetic exception and the other implementing ArrayindexOutOfBound exception. ye | Wile 2 java program thal Implements a multithreaded application that has three toads, First thread generates a random integer every 10 second and if the value is even, second thread computes the square of the number and prints Ifthe value is odd. the third thread will print the value of cube of the number. je | Write @ Java program to insert an element into|an array and reverse an array using packages 3 | Wile a program to exhibit simple inheritance, multilevel inheritance and hybrid inheritance concepts. Detine an interface “QueueOperations” whieh declares miei “MyQueue” which contains an array above interface, Initialize the queue aqueue object: thods for a static queue, Define a class | and front and rear as data members and implements the | Using @ constructor. Write the code to perform operations on Write ajava class called student” with name, and rolIno, Write a class “Result? fo get Marks of Subjects and another class “Sports’ to get the points obtained in sports. Calculate the total Marks and displays the result (pass or fail) with points obtained in sports for three students using inheritance and constructor reg_no, model, reg_date, Define two subclasses of “ransportVehicles ” (validity no, start date, period) and “privateVehicle ” (owner_name, owner_address), Define appropriate constructors, Create n objects which could be ofelther transport Vehicles or privateVehicle class by asking the user's choice. Display details of all “privateVehicle” objects and all “transport Vehicles” objects, Define an abstract elass “car” with members this class Greate an, interfice “GreditCardinterface” with meihods to viewCreditAmount, viewPin, changePin and payBalance, Create a class Customer (name, card number, pin, creditAmount — initialized to 0), Implement methods of the interface “CreditCurdInterface” in Customer class Create nn array of customer objects and perform the following actions. Pay Balance © Change Pin Write a Java program to perform the following task. + Take an integer atray of size 20, initialize values randomly between 10 and 90, | simultaneously sum all values and caleulate average, Now separate values below average and above average in ArrayLists, Finally print both lists in 2 separate rows. 10 'a, Write a Java program that reads a siring from inpiits containing first name, last name and | computes an e-mail address with first 3 letters of the first name, first 4 letiers of last name, <” separator and domain. Display the outputs by invoking objects. (40) b. Create a java abstract class to implement stack concept. Check for the overflow and empty conditions. (40) java program for exception handling: a, To create a user defined exception whenever user input the word “hello”. b, To add two integers and raise exception when any other character except number (0 — 9) given as input, Create a ciass Doctor with attributes id, name, age and department. Initialize values through parameterized constructor, If age of Doctor is not in between 25 and 65 then generate user- defined exception “AgeNotWithinRangeException”. If name contains numbers or special symbols raise exception “NameNotValidException”. Define the two exception classes. +} Write a Java program ‘WordCount’ that coun TA program uccepts two inicgers as command line arguments, It displays ali prime numbers between these two. Validate the input for the following criteria: Both should be positive integers. “The second should be larger than the first. Create user defined exceptions for both he words in one or more files. S for-ach file. For example, if-you call “java WordCount report.txt address.txt Homework,java “ then the program might print address.txt: 1052 Homework,java: report.txt: 2099 {will count the number of lines in each files that is, Wille a Java program ‘CineCoi specified on the command line, Note that multiple files can be specified, asin ‘jaya LineCounts filel.txt file2,txt file3.txt". Write a program TestThreadMany.java that takes a positive integer n from the command line and creates exactly n threads that print out their own name, Here is « sample execution: $ java Test ThreadMany 4 Hello, [am Thread #1 Hello, am Thread #2 Hello, Fam Thread #3 Hello, fam Thread #4 | | @. Write a Java program to demonstrate that as a high-priority thread executes, it will delay the | execution of all lower-priority threads. (40) , Write a Java program to read from an input file and convert the words to lower casc and write | ivin another file (40) \Write java programs that include generic method fo satisfy the following property. a. To counts the number of odd integers in an integer list 6. To exchange the positions of two different elements in an array. | ©. To find the maximal clement in the range (begin, end] of a list. hi | Greate a new Java GUI application to convert miles to kilometers when pressing the “Convert!” button, Note that you need to implement the ActionListener interface and override the actionPerformed() method. Note that | mile is equal to 1.609 kilometers Create a new Java GUI application thal moves a snowman on a panel. The position of the snowman can be chenged using the control buttons. With the four buttons, a user can move the snowman to the left, right, up or down position.

You might also like