Labels

Friday, 1 April 2011

Lab exercises for Externals

Dear Friends

Here are the Lab Exercises in 2 categories (easy and difficult). Expect one from each category and a total of 2 programs for the externals. Simple program carries 10 marks for writing and 5 marks for execution. Difficult Program carries 15 marks for writing and 5 marks for execution. 15 marks will be provided for Viva.

----------------- simple programs ----------------------

1. Find the roots of a quadratic equation a*x*x + b*x + c by taking inputs a, b, c from user

2. Generate Fibonacci sequence up to a given number n.

3. Demonstrate Matrix multiplication by accepting numbers as input from the user

4. Find the sum of all integers by accepting them as input from user. Use StringTokenizer class.

5. Check if an input string is a Palindrome.

6. Sort input strings (accepted from the user) in ascending order.

7. Sort input strings (accepted from the user) in descending order.

8. Read a filename (from the user), display if the file exists, if it is a file or a directory, if it is readable, writable, the type of the file and its extension

9. Write a program to implement a character stack.

10. Read a file and display its contents on the screen line by line. Each line should be preceded by " Line #:" -

For example - If the contents of the file are

hello there
this is the world
as you and i see it

The output should be

Line 1:hello there
Line 2:this is the world
Line 3:as you and i see it

------------------------- difficult programs ---------------------------------------------

11. Read a file and print the number of characters, words and lines in the file.

12. Use the character stack and convert an infix expression to a postfix expression. The expression has single digit numbers only.

13. Write an applet that accepts a number in a textField and upon the click of a button will display the factorial of the number as a string. The button and textfield should appear upon starting the applet each time (not initializing) and they should disappear when the factorial is displayed on the screen.

14. Write an AWT Frame that accepts choices from many teams (India, SriLanka, Pakistan, New Zealand) and displays who the winner is on the screen.Between India and Pakistan only one team can be chosen. Between Sri Lanka and India only one team can be chosen (use a checkbox group for this).

15. Write a Program that creates 3 threads. First thread displays "Good Morning" every second, second thread displays "Hello" every 2 seconds and third thread displays "Welcome" every 3 seconds.

---------------------------------------------------------------------------------------------------------

1 comments:

Unknown said...

Sir...
I didn't get 14th one...
which options to be grouped together...

Post a Comment