Worksheet 2 Subject: Computer Applications Class X
Worksheet 2 Subject: Computer Applications Class X
Date
1. Write a class with name employee and basic as its data members to
find the gross pay of an employee for the following allowances and deduction. Dearness Allowance =25 % of Basic pay. House Rent Allowance =15% of Basic Pay. Provident Fund=8.33 % of Basic Pay. Net Pay=Basic pay Dearness Allowance House Rent Allowance Gross pay=Net Pay-Provident Fund. 2. Write a program to check greatest number between two numbers 3. Write a program to check greatest number among three numbers. 4. Write a program to check the divisibility of number a by another number say b 5. Accept a number from keyboard and check whether it is positive number, negative number o r a zero. Print a suitable message 6. Write a program in java to accept a number and find whether it is an even or odd by using the input statement. 7. Write a program to check whether given number is leap year or not. 8. A voter is eligible to vote for the election held in his city if his age is at least 18 years. Define a class eligibility test that check for the eligibility of a voter. 9. WAP in java to find the temperature in Fahrenheit by using input statement when temperature is accepted in Celsius. if the temperature is 98.6 F or more then display Fever else Normal. f=9*c/5+32 10.Write a program in java to accept the sides of a triangle and display whether it is an equilateral or isosceles or a scanlene triangle. 11.Write a program to check whether given triangle is right angle triangle. 12.Write a program to check whether triangle is possible or not.