Skip to content

Latest commit

 

History

History
58 lines (26 loc) · 4.76 KB

README.md

File metadata and controls

58 lines (26 loc) · 4.76 KB
                                              TITLE: Basic Java Programming

Ques1:Write a program to find the largest of 3 numbers.

Ques2:Write a program to implement a command line calculator.

Ques3:Write a program to accept 10 student’s marks in an array, arrange it into ascending order, convert into the following grades and print marks and grades in the tabular form. Between 40 and 50 : PASS Between 51 and 75 : MERIT and above : DISTINCTION

Ques 4:WAP to Take input as DD MM YYYY(04 08 2021) in command line and calculatenumber of days since 1 January 1970.

Ques5:WAP to print increasing right angle tringle

Ques6:Write a program to accept three digits (i.e. 0 - 9) and print all its possible combinations. (For example if the three digits are 1, 2, 3 than all possible combinations are : 123, 132, 213, 231, 312, 321.)

Ques7:Write a Java Program to accept 10 numbers in an array and compute the square of each number. Print the sum of these numbers.

Ques8:Write a program to input a number of a month (1 - 12) and print its equivalent name of the month.( e.g 1 to Jan, 2 to Feb. 12 to Dec.)

Ques9:Write a program to find the sum of all integers greater than 40 and less than 250 that are divisible by 5.

                                                            TITLE:INHERITANCE

Ques 10:.Write a Java program to show that private member of a super class cannot be accessed from derived classes?

Ques11:Write a program in Java to create a Player class. Inherit the classes Cricket_Player, Football Player and Hockey Player from Playerclass.

Ques 12:Write a class Worker and derive classes DailyWorker and SalariedWorker from it. Ever worker has a name and a salary rate. Write method ComPay (int hours) to compute the week pay of every worker. A Daily Worker is paid on the basis of the number of days he/she works. The Salaried Worker gets paid the wage for 40 hours a week no matter what the actual hours are. Test this program to calculate the pay of workers. You are expected to use the concept of polymorphism to write this program?

Ques13:Consider the trunk calls of a telephone exchange. A trunk call can be ordinary, urgent or lightning. The charges depend on the duration and the type of the call. Write a program using the concept of polymorphism in Java to calculate the charges.

Ques 14:Design a class employee of an organization. An employee has a name, empid, and salary .Write the default constructor, a constructor with parameters (name, empid, and salary) and methods to return name and salary. Also write a method increase Salary that raises the employee’s salary by a certain user specified percentage. Derive a subclass Manager from employee. Add an instance variable named department to the manager class. Supply a test program that uses theses classes and methods.

                                                             TITLE:PACKAGES

Ques 15: Write a Java program to implement the concept of importing classes from user definedpackage and created packages.

Ques 16:Write a program to make a package Balance. This has an Account class with Display_Balance method. Import Balance package in another program to accessDisplay_Balance method of Account class.

Ques 17:WAP to create a package p with class A with 4 types of access protected methods. Howwe will use these methods in different packages class i.e. there is main() in class B inpackage Q and 4 methods are in Class A in package p.

                                                              TITLE: Interface

Ques 18:Write a program to create interface named test. In this interface the member function is square. Implement this interface in arithmetic class. Create one new class called To TestInt. In this class use the object of arithmetic class.

Ques 19:Write a program to create interface A, in this interface we have two method meth1 and meth2. Implements this interface in another class named MyClass

Ques 20:Write a program in Java to show the usefulness of Interfaces as a place to keepconstant value of the program

Ques 21:Write a program to create an Interface having two methods division and modules. Createa class, which overrides these methods.

Ques 22:Write a program to create an interface StackInterface having methods push (), pop ()and display (). StackClass implements StackInterface. Class StackClass containsthe main method which is having a switch case for selecting the particularoperation of the stack.