First Assessment Computer Applications Class 9
First Assessment Computer Applications Class 9
Question 1.
Question 2.
Question 3.
if(a>5)
int y=x+2;
else
int y=x-2;
Page 1 of 4
{
int t=(int)25.75; int c=’a’;
System.out.println(“Value of t=” + t +“ ” +c);
}
2𝑎𝑏
(g) Write java expression for (𝑎2 + 𝑏 2 ) [2]
3
(h) Give the result for the following expression where a=7
a+=a++ + ++a + --a; [2]
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
so that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.
Question 4. [15]
Write a program to input two unequal numbers by using the Scanner class and
swap the two numbers. Display the numbers before swapping and after
swapping.
Page 2 of 4
Question 5. [15]
Question 6. [15]
In an examination you have appeared for three subjects i.e. physics, chemistry
and biology. Write a program in Java to calculate and display the average
mark obtained. Take physics, chemistry and biology marks as inputs through
the Terminal window.
Question 7. [15]
A shopkeeper sells two calculators for the same price. He earns 20% profit on
one and suffers a loss of 20% on the other. Write a program to find and
display his total cost price of the calculators by taking their selling price as
input through a parameter.
Question 8. [15]
Write a program to input three numbers using the Scanner class and find and
display the largest of the numbers using ternary operator.
Question 9. [15]
Write a program to find and display the area and perimeter of a right-angled
triangle taking the base and height as the inputs from the user. Pass the
inputs through function argument.
********************
Page 3 of 4