You are on page 1of 5

1. Write a program with different methods to convert Fahrenheit to Celsius and Celsius to Fahrenheit.

2. Write a program to take input from the user and calculate sales-tax.

3. Write a program to take input from the user and calculate interest rate (10%) for giving loan.

4. Write a program that reads in the radius and length of a cylinder and computes volume.

5. Write a program that converts pounds into kg. The program prompts the user to enter a number of pounds, converts it to kg and displays the result [ 1 pound is 0.454 kg].

6. Write a program that reads an integer 0 to 1000 and adds all the digits in integer. [For example: 911 (input) -> 11 (result)].

7. Write a program that converts lowercase letter to uppercase letter. [hint: int offset = a A; char uppercase = (char) (lowercase-offse) ]

8. Write a program that receives an ASCII code (int between 0 128) and display its character [example : 97 (input) -> A(output)]. 9. Write a program that reads following information -> Employees name, number of hours worked in week, hourly pay rate, tax (20%) with-holding from user and prints a payroll statement with employees details.

10. Write a program that reads in investment amount, annual interest rate and number of years. Display the future investment value of the person.

11. Write a program that calculates the energy needed to heat water from an initial temperature to final temperature. Your program should prompt the user to enter the amount of water in kg and initial and final temperature of water.

12. Write a program that displays the following table (5 IN ROW): a b pow(a,b) a b pow(a,b) --------------------------------------------------------------1 2 1 6 7 ______ 2 3 8 7 8 _________ 3 4 81 8 9 ______ 4 5 9 10 5 6 10 11 13. Write a program to calculate leap year.

14. Write a program that reads an integer and checks whether it is even, odd or prime number, print the same as output.

15. Write a program which sorts given numbers, which is provided by user.

16. Write a program to display multiplication table for the given number by user.

17. Write a program to calculate GCD and LCM of the given input from user in different methods.

18. Write a program that prompts the user to enter the number of students and each students name and score. Finally display the student with highest score.

19. Write a program that displays all number from 100 to 1000, ten per line that are divisible by 5 and 6.

20. Use a while loop to find the smallest integer n such that n square (n2) is greater than 12000.

21. Write a program that display all leap years, ten per line, in the twenty first centure (2001 to 2100).

22. Write a program that prompts the user to enter a decimal integer and display its corresponding binary value. Use built-in class and without built-in class.

23. Write a program to display an integer in reverse order [ example : 1345 (input) -> 5431 (output)].

24. Write a program that prompts the user to enter a decimal integer and display its corresponding hexadecimal value.

25. Write a program to find if the given input is palindrome or not. Also include different method to see if number is prime or not.

26. Write a program which reads the score, then finds best score and finally assigns grades to the students and prints the students details in order. (use array)

27. Write a program to count number letters in given array, with built-in function and without built-in functions.

28. Write a program which prompts for set of elements and search given key element.

29. Write a program to sort given array elements using insertion sort.

30. Write a program that reads eleven number from user, computes their average, and finds out how many numbers are below average and displays duplicate numbers.

31. Write two overloaded methods that return the average of an array with following headers: public static int averate(int[] array); and public static double average(double[] array). 32. Write a program which reads two matrices (2 D) and adds two matrices and displays the output on screen.

33. Write a program with different methods to do these array operations -> sort an array and search an element inside it, determine the upper bound of 2D array.

34. Write a program with different methods to do these array operations -> sort an array and insert an element inside it, determine the upper bound of 2D array.

35. Write a program with different methods to do these array operations -> reverse an array, search mini and the maxi element in an array.

36. Write a program with different methods to do these array operations -> compare two arrays and display if it is equal or not.

37. Write a program to use methods for calculating Fibonacci series using recursion.

38. Write a program to use recursion for calculating factorial of a number.

39. Write a program to demonstrate various arithmetic and assignment operations, right shift and left shift. 40. Write a program to accept string in command line and print the same, also count how many characters are in the given string. 41. Write a program to demonstrate various relational and logical operations. 42. Write a program using different methods to demonstrate conditional operator and do type conversions from -> double to float, short to int, double to int, chat to int, int to short. 43. Write a program using different methods with different control flow controls (for, switch, while) to check whether an alphabet is a vowel or not.
44. Write an exception which catches if the value is very small(eg:<.01) 45. WAP which catches different exceptions 1.divide by 0, 2.Array bound index error 3.Wrong datatype. 46. WAP to catch wrong input frm command line argument. 47. A simple applet to display a msg:HELLO WORLD on applet window. 48. Do d above pgm by passing parameters and align d msg.

49. Your own exception -> if number is two small, (declare variables as float, do any arithmetic operations if the output is less than 0.01 then call and exception). 50. Write a java program which catches exception for divide by zero and array index error and wrong data type. 51. Write a java program to catch wrong input from command line, ( declare int variable but input of different type). 52. Display "Hello World " on applet window 53. Pass parameters and display string on applet screen. 54.Align the output "Helloworld" to rightmost corner, below, middle, leftmost corner, anywhere on the applet screen. 55. Write a program to calculate the value of X= sin x+cosx+tanx using multiple threads. 56. Define a thread using thread class to generate the factorials of first 20 natural numbers. create an instance for this thread and then activate it. 57. Write a program to generate the square roots of the first 30 natural numbers using Runnable Interface. 58. Define a thread to display the odd numbered element in an array of size 50. define another thread to display even numbered element in another array of size 50. Create instances of the above threads and run them. 59. Write a program that executes three threads. first thread displays Good morning every one second. second thread displays hello every two seconds and the third thread displays welcome in every three seconds. create the three threads by extending the thread class.

You might also like