0% found this document useful (0 votes)
27 views1 page

Worksheet 2 Subject: Computer Applications Class X

The document contains instructions for 11 programming exercises: 1. Write a class to calculate employee gross pay based on basic pay, allowances, and deductions 2. Write a program to find the greatest of two numbers 3. Write a program to find the greatest of three numbers 4. Write a program to check if a number is divisible by another number 5. Write a program to check if a number is positive, negative, or zero 6. Write a program to check if a number is even or odd 7. Write a program to check if a year is a leap year 8. Write a class to check voter eligibility based on age 9. Write a program to check temperature and display fever

Uploaded by

Navneet Sekhon
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

Worksheet 2 Subject: Computer Applications Class X

The document contains instructions for 11 programming exercises: 1. Write a class to calculate employee gross pay based on basic pay, allowances, and deductions 2. Write a program to find the greatest of two numbers 3. Write a program to find the greatest of three numbers 4. Write a program to check if a number is divisible by another number 5. Write a program to check if a number is positive, negative, or zero 6. Write a program to check if a number is even or odd 7. Write a program to check if a year is a leap year 8. Write a class to check voter eligibility based on age 9. Write a program to check temperature and display fever

Uploaded by

Navneet Sekhon
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

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.

You might also like