Tuesday, September 20, 2022

Core Java Solve practical Slips


 Slip1 Q.1. Core Java: A) Write a ‘java’ program to display characters from ‘A’ to ‘Z’

 Slip 1 .B)Write a ‘java’ program to copy only non-numeric data from one file to another file


Slip 2.A) Write a java program to display all the vowels from a given string

 

Slips 2.B)Design a screen in Java to handle the Mouse Events such as MOUSE_MOVED and MOUSE_CLICK and display the position of the Mouse_Click in a TextField.


Slip3 Q.1. Core Java: A) Write a ‘java’ program to check whether given number is Armstrong or not. (Use static keyword)


 

Slip 3. B)Define an abstract class Shape with abstract methods area () and volume (). Derive abstract class Shape into two classes Cone and Cylinder. Write a java Program to calculate area and volume of Cone and Cylinder.(Use Super Keyword.)


 

Slip4 Q.1. Core Java: A) Write a java program to display alternate character from a given string.[15M]


 

Slip 4.B) Write a java program using Applet to implement a simple arithmetic calculator.


 


Slip 5.A) Write a java program to display following pattern:

        5

        4 5

        3 4 5

        2 3 4 5 

        1 2 3 4 5 


 

Slip 5.B) Write a java program to accept list of file names through command line. Delete the files having extension .txt. Display name, location and size of remaining files.

 


Slip 6.A) Write a java program to accept a number from user, if it zero then throw user defined Exception “Number Is Zero”, otherwise calculate the sum of first and last digit of that number. (Use static keyword).



Slip 6.B) Write a java program to display transpose of a given matrix.



Slip 7.A) Write a java program to display Label with text “Dr. D Y Patil College”, background color Red and font size 20 on the frame.



Slip 7.B) Write a java program to accept details of ‘n’ cricket player (pid, pname, totalRuns, InningsPlayed, NotOuttimes). Calculate the average of all the players. Display the details of player having maximum average. (Use Array of Object)



slip8 Q.1. Core Java: A) Define an Interface Shape with abstract method area(). Write a java program to calculate an area of Circle and Sphere.(use final keyword) [15 M]



Slip 8.B) Write a java program to display the files having extension .txt from a given directory.

 

Slip 9A)Write a java Program to display following pattern:

            1 

            0 1 

            0 1 0 

            1 0 1 0

 



Slip 9.B) Write a java program to validate PAN number and Mobile Number. If it is invalid then throw user defined Exception “Invalid Data”, otherwise display it. 




Slip 10 A) Write a java program to count the frequency of each character in a given string.

 

Slip 10 B) Write a java program for the following:




Slip 11.A) Write a menu driven java program using command line arguments for thefollowing: 

            1. Addition 

            2. Subtraction 

            3. Multiplication

            4. Division.import java.util.Scanner;

 

Slip 11.B) Write an applet application to display Table lamp. The color of lamp should get change randomly. 


 

SLIP 12.B) Write a java program to display multiplication table of a given number into the List box by clicking on button


 

Slip13 Q.1. Core Java: A) Write a java program to accept ‘n’ integers from the user & store them in an ArrayList collection. Display the elements of ArrayList collection in reverse order. [15 M]


 

Slip 13.B) Write a java program that asks the user name, and then greets the user by name. Before outputting the user's name, convert it to upper case letters. For example, if the user's name is Raj, then the program should respond "Hello, RAJ, nice to meet you!".

 

   Slip 14 A) Write a Java program to calculate power of a number using recursion.

 

Slip 14 B) Write a java program to accept the details of employee (Eno, EName, Sal) and display it on next frame using appropriate event .


 

Slip 15 A) Write a java program to search given name into the array, if it is found then display its index otherwise display appropriate message.


 

Slip 15 B) Write an applet application to display smiley face.


 

Slip 16 A) Write a java program to calculate sum of digits of a given number using recursion.


 

Slip 16 B) Write a java program to accept n employee names from user. Sort them in ascending order and Display them.(Use array of object and Static keyword)


 

SLIP 17.A) Write a java Program to accept ‘n’ no’s through command line and store only armstrong no’s into the array and display that array


 


SLIP 17.B) Define a class Product (pid, pname, price, qty). Write a function to accept the product details, display it and calculate total amount. (use array of Objects)


 

SLIP 18.A) Write a Java program to calculate area of Circle, Triangle & Rectangle.(Use Method Overloading)


 

SLIP 18.B) Write a java program to copy the data from one file into another file, while copying change the case of characters in target file and replaces all digits by ‘*’ symbol.


 

Slip19 Q.1. Core Java: A) Write a Java program to display Fibonacci series using function. [15 M] 


 

SLIP 19.B) Create an Applet that displays the x and y position of the cursor movement using Mouse and Keyboard. (Use appropriate listener)


 

SLIP 20.A) Write a java program using AWT to create a Frame with title “TYBBACA”, background color RED. If user clicks on close button then frame should close.


 

SLIP 20.B) Construct a Linked List containing name: CPP, Java, Python and PHP. Then extend your java program to do the following: 

 i. Display the contents of the List using an Iterator 

 ii. Display the contents of the List in reverse order using a ListIterator



Slip21 Q.1. Core Java: A) Write a java program to display each word from a file in reverse order. [15 M] 


 

Slip 21 B) Create a hash table containing city name & STD code. Display the details of the hash table. Also search for a specific city and display STD code of that city.


 

Slip 22 A) Write a Java program to calculate factorial of a number using recursion.


 

Slip 22 B) Write a java program for the following:

1. To create a file.

2. To rename a file.

3. To delete a file.

4. To display path of a file.


 

Slip 23 A) Write a java program to check whether given file is hidden or not. If not then display its path, otherwise display appropriate message.

 



Slip 23 B) Write a java program to design following Frame using Swing.


 


slip24  Q.1. Core Java: A) Write a java program to count number of digits, spaces and characters from a file. [15 M]


 

Sli24.B) Create a package TYBBACA with two classes as class Student (Rno, SName, Per) with a method disp() to display details of N Students and class Teacher (TID, TName, Subject) with a method disp() to display the details of teacher who is teaching Java subject. (Make use of finalize() method and array of Object)


 


Slip25 Q.1. Core Java: A) Write a java program to check whether given string is palindrome or not. [15 M] 

 


 

Slip 25.B) Create a package named Series having three different classes to print series: 

            i. Fibonacci series 

            ii. Cube of numbers 

            iii. Square of numbers 

Write a java program to generate ‘n’ terms of the above series

NOTE: THIS QUESTION HAS TWO PROGRAMS TO BE WRITTEN AND COMPILED DIFFERENTLY.


Program 1:

Program 2:

 


Slip26 Q.1. Core Java: A) Write a java program to display ASCII values of the characters from a file. [15 M] 


 

Slip 26 B) Write a java program using applet to draw Temple.


 

Slip 27 A) Write a java program to accept a number from user, If it is greater than 1000 then throw user defined exception “Number is out of Range” otherwise display the factors of that number. (Use static keyword)


 

 Slip 27 B) Write a java program to accept directory name in TextField and display list of files and subdirectories in List Control from that directory by clicking on Button.


 

 Slip 28 A) Write a java program to count the number of integers from a given list. (Use Command line arguments).



Slip 28 B) Write a java Program to accept the details of 5 employees (Eno, Ename, Salary) and display it onto the JTable.


 

Slip 29 A) Write a java program to check whether given candidate is eligible for voting or not. Handle user defined as well as system defined Exception.


 

Slip 29 B) Write a java program using Applet for bouncing ball. Ball should change its color for each bounce.


 

Slip 30 A) Write a java program to accept a number from a user, if it is zero then throw user defined Exception “Number is Zero”. If it is non-numeric then generate an error “Number is Invalid” otherwise check whether it is palindrome or not.


 

Slip 30 B) Write a java program to design a following GUI (Use Swing).

 

No comments:

Post a Comment