1. a) Write a Java program that prints all real solutions to the quadratic equation ax2+bx+c=0. Read in a, b, c and use the quadratic formula. If the discriminant b 2 -4ac is negative,display a message stating that there are no real solutions.
b) Write a Java program that find prime numbers between 1 to n.
c) Write a Java Program that find the factorial of a number
2. a) The Fibonacci sequence is defined by the following rule: The first two values in the sequence are 1 and 1. Every subsequent value is the sum of the two values preceding it. Write a Java program that print the nth value in the Fibonacci sequence.
b) Write a Java program that checks whether a given string is a palindrome or not. Ex: MADAM is a Palindrome.
c) Write a Java program for sorting a given list of names in ascending order
3. a) Write a java program to split a given text file into n parts. Name each part as the name ofthe original file followed by part where n is the sequence number of the part file
b) Write a java program to convert an Array List to an Array.
c) Write a Java program to make frequency count of vowels, consonants, special symbols, digits, words in a given text.
4. a) Write a Java program that reads a file name from the user, then displays information about whether the file exists, whether the file is readable, whether the file is writable, the type of file and the length of the file in bytes.
b) Write a Java program that reads a file and displays the file on the screen, with a line number before each line.
c) Implement Stack using queues.
5. a) Write a java program to make rolling a pair of dice 10,000 times and counts the number of times doubles of are rolled for each different pair of doubles. Hint: Math.random().
b) Write java program that inputs 5 numbers, each between 10 and 100 inclusive. As each number is read display it only if it‘s not a duplicate of any number already read display the complete set of unique values input after the user enters each new value.
c) Write a java program to read the time intervals (HH:MM) and to compare system time if the system time between your time intervals print correct time and exit else try again to repute the same thing. By using String Toknizer class.
6. a) Write java program to create a super class called Figure that receives the dimensions oftwo dimensional objects. It also defines a method called area that computes the area of an object. The program derives two subclasses from Figure. The first is Rectangle and second is Triangle. Each of the sub class overridden area() so that it returns the area of a rectangle and a triangle respectively.
b) Write a Java program that creates three threads. First thread displays ―Good Morningǁevery one second, the second thread displays ―Helloǁ every two seconds and the third thread displays ―Welcomeǁ every three seconds
7. a) Write a Java program that correctly implements producer consumer problem using the concept of inter thread communication.
b) Use inheritance to create an exception super class called Exception A and exception sub class Exception B and Exception C, where Exception B inherits from Exception A and Exception C inherits from Exception B. Write a java program to demonstrate that the catch block for type Exception A catches exception of type Exception B and Exception C
8. Write a Java Program to design login window using AWT components.
9. Develop an application for simple calculator. Use a grid layout to arrange buttons for the digits and for the +, -,*, % operations. Add a text field to display the result
10. Design & Develop an application that creates a user interface to perform integer divisions. The user enters two numbers in the Jtext Fields, Num1 and Num2. The division of Num1 and Num2 is displayed in the Result field when the Divide button is clicked. If Num1 or Num2 were not an integer, the program would throw a Number Format Exception. If Num2 were Zero, the program would throw an Arithmetic Exception Display the exception in a message dialog box.
11. Design a GUI application that simulates a traffic light. The program lets the user select one of three lights: red, yellow, or green. When a radio button is selected, the light is turned on, and only one light can be on at a time No light is on when the program starts.
12. a) Design a GUI application for Cafeteria bill generation.
b) Create a database connection using JDBC & perform some basic operation such as add, remove, update record in database using JDBC.
We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.