Average of Given Numbers
You are given space-separated integers as input. Write a program to print the average of the given numbers.
The first line of input contains space-separated integers.
The output should be a float value rounded up to two decimal places.
In the example, input is
1, 0, 2, 5, 9, 8. The sum of all numbers present in the list is 25, and their average is 25/6.So, the output should be
4.17.
First Prime Number
You are given
N inputs. Write a program to print the first prime number in the given inputs.
Input
The first line of input is an integer
N. The next N lines each contain an integer.
Explanation
In the given example of
5 integers
1
10
4
3
2
The output should be
3.
Sample Input 1
5
1
10
4
3
2
Sample Output 1
3
Sample Input 2
4
2
3
5
7
Sample Output 2
2
Write a program to show the use of static functions and to pass variable length
arguments in a function.
Write a program to display a message in window using Applet class.
Write a java program to demonstrate static keyword. The program consist three
method with parameters and also use the display method to show the output of
program.
Write a program to demonstrate different mouse handling events like
mouseClicked(), mouseEntered(), mouseExited(), mousePressed,
mouseReleased() and mouseDragged().
Write a program that show working of different functions of String and
StringBuffer classs like setCharAt(), setLength(), append(), insert(), concat()and
equals().
Write a program ―DivideByZeroǁ that takes two numbers a and b as input,
computes a/b, and invokes Arithmetic Exception to generate a message when the
denominator is zero.
Write a program that creates illustrates different levels of protection in
classes/subclasses belonging to same package or different packages.