A company announces revised Dearness Allowance (DA) and Special Allowance (SA) for their employees.This Java program calculates the Dearness Allowance (DA) and Special Allowance (SA) for employees based on their basic salary. The program uses if-else conditions to determine the applicable percentage for DA and SA as per the salary ranges, then calculates and displays the amount of both allowances. Read more
|
|
Basic |
Dearness Allowance (DA) |
Special Allowance (SA) |
|
Up to Rs. 10,000 |
10% |
5% |
|
Rs. 10,001 to Rs. 20,000 |
12% |
8% |
|
Rs. 20,001 to Rs. 30,000 |
15% |
10% |
|
Rs. 30,001 and above |
20% |
12% |
This program calculates the total discount and final price of a flat based on its floor category. The user inputs the price of the flat and the floor category (‘0’ for ground floor, ‘1’ for first floor, ‘2’ for second floor, ‘3’ for third floor), and the program computes the discount on both the price and the development charge. The total discount is then applied to give the final price of the flat after the discount.
Read more|
Category |
Discount on the price |
Discount on Development Charge |
|
Ground floor |
10% |
8% |
|
First floor |
2.0% |
1.0% |
|
Second floor |
5% |
5% |
|
Third floor |
7.5% |
10% |
This program is a menu-driven volume calculator that computes the volume of: A cube using the formula V = s³ (where s is the side of the cube). A sphere using the formula V = (4/3) * π * r³ (where r is the radius). A cuboid using the formula V = l * b * h (where l is length, b is breadth, and h is height). The program uses a switch case to allow the user to select which volume to compute. It validates the input and provides an appropriate error message if the user enters an invalid choice.
Read moreRead Answer
This Java program is a menu-driven tool that allows users to perform one of the following mathematical evaluations: Natural logarithm: Computes the natural logarithm (log base e) of a positive number. Absolute value: Finds the absolute value of any number. Square root: Computes the square root of a non-negative number. Random number: Generates a random number between 0 and 1. The program uses a switch statement to handle user choices. Each operation has its specific calculation using Java
Read moreRead Answer
Description of the Program Input: The program presents a menu to the user, allowing them to choose between calculating the area of a circle, square, or rectangle by entering 'c', 's', or 'r'. Switch Statement: The user's choice is evaluated using a switch statement.
Read more
This program provides a menu-driven interface for converting temperatures between Fahrenheit and Celsius. The user can choose to either convert Fahrenheit to Celsius or Celsius to Fahrenheit by entering the respective option. The formulas used for conversion are: Celsius from Fahrenheit: � = 5 9 ( � − 32 ) C= 9 5 (F−32) Fahrenheit from Celsius: � = 1.8 × � + 32 F=1.8×C+32 If the user makes an invalid selection, the program displays an error message prompting the
Read moreRead Answer
This program allows the user to perform basic arithmetic operations (sum, difference, product) on two numbers through a menu-driven interface. The user is prompted to choose an operation by entering a specific symbol: ‘+’ to calculate the sum ‘-’ to calculate the difference ‘*’ to calculate the product After selecting an operation, the user inputs two numbers, and the program calculates and displays the result based on the chosen operation. If an invalid option is entered, the program info
Read moreRead Answer
This Java program uses a switch statement to accept an integer between 1 and 7 from the user and displays the corresponding weekday (Monday to Sunday). If the input is not within this range, an error message is shown. Example: Input: Enter a number (1-7): 3 Output: Wednesday
Read moreUsing Switch Case, write a program that allows
Ton to accept any values from 1 to 7 and displays the weekdays corresponding to
the number entered from the keyboard.
This Java program calculates the interest earned and the final amount paid for term deposit schemes offered by the Bank of India. The interest rate varies based on the term and whether the customer is a senior citizen or not. It displays the deposited amount, term, age of the customer, interest earned, and the final amount paid.
Read more‘Bank
of India’ announces new rates for Term Deposit Schemes for their customers
and Senior Citizens as given below:
|
Term |
Rate of Interest (General) |
Rate of Interest (Senior Citizen) |
|
Up to 1 year |
7.5% |
8.0% |
|
Up to 2 years |
8.5% |
9.0% |
|
Up to 3 years |
9.5% |
10.0% |
|
More than 3 years |
10.0% |
11.0% |
The
senior citizen applies to those customers, whose age is 60 years or more.
Write a program to accept the sum (p) in the term deposit scheme, the age of the
customer and the term. The program displays the information in the given
format:
|
Amount Deposited |
Term |
Age |
Interest earned |
Amount Paid |
|
Xxx |
xxx |
Xxx |
xxx |
xxx |
This Java program calculates the monthly gross salary and net salary of an employee based on their basic salary, with dearness allowance, house rent allowance, provident fund, and employee provident fund. It also checks if the employee is an income tax payer based on their gender and annual gross salary.
Read more|
Dearness Allowance |
Nature |
|
House Rent Allowance |
40% of Basic Salary |
|
Provident Fund |
12% of Basic Salary |
|
Employee Provident Fund |
2% of Basic Salary |
Gross Salary = Basic + DA + HRA
Net Salary = Gross Salary – (PF + EPF)
|
Category |
Annual Gross Salary |
|
|
Male (M) |
Up to Rs. 1,50,000/- |
Income Tax Payer |
|
Female (F) |
Up to Rs. 2,00,000/- |
Not an Income Taxpayer |
This Java program determines the eligibility of a student for different streams (Pure Science, Bio Science, Commerce) in Std. 11th based on their marks in English, Math, and Science.
Read more|
Marks obtained in different subject |
Stream |
|
English, Math’s and
Science>=80% |
Pure Science |
|
English and
Science>=80%, Math’s>=60% |
Bio. Science |
|
English, Math’s and
Science>=60% |
Commerce |
This Java program calculates the income tax payable based on the given salary slabs. It uses conditional statements to determine the correct tax bracket and calculate the tax accordingly.
Read more|
Annual Salary |
Rate of Income Tax |
|
Up to Rs. 1,00,000 |
No Tax |
|
Rs. 1,00,000 to Rs.
1,50,000 |
10% of the amount
exceeding Rs. 1,00,000 |
|
Rs. 1,50,000 to Rs.
2,50,000 |
Rs. 5000+20% of the amount
exceeding Rs. 1,50,000 |
|
Above Rs. 2,50,000 |
Rs. 25,000+30% of the
amount exceeding Rs. 2,50,000 |
This Java program calculates the fine for late returns in a library. The fine rates vary depending on the number of days late: 40 paisa/day for the first 5 days, 60 paisa/day for the next 5 days, and 80 paisa/day for any days beyond 10.
Read more|
First five days |
40 paisa/day |
|
Six to ten days |
60paisa/day |
|
Above ten days |
80 paisa/day |
This Java program allows users to input item details, calculates the total purchase price, and determines an appropriate gift based on the total amount spent. The program also provides an option to add more items and concludes with a thank you message.
Read more|
Amount of Purchase (Rs.) |
Gift |
|
100 and above but less
than 500 |
A key ring |
|
500 and above but less
than 1000 |
A leather purse |
|
1000 and above |
A pocket calculator |
This Java program computes the annual water conservation tax for a user based on their water consumption in gallons. The tax is calculated according to a tiered tax rate structure.
Read more|
Water consumed (in Gallons) |
Tax Rate in Rs. /100 gallons |
|
Up to 45 |
No Tax |
|
More than 45 but 75 or
less |
475.00 |
|
More than 75 but 125 or
less |
750.00 |
|
More than 125 but 200 or
less |
1225.00 |
|
More than 200 but 350 or
less |
1650.00 |
|
More than 350 |
2000.00 |
This Java program calculates the charges for sending a parcel based on its weight. The first 1 kg is charged at Rs. 15, and any additional weight is charged at Rs. 8 for each 500g or fraction thereof.
Read moreRead Answer
This Java program calculates the gross salary of an employee by applying the Dearness Allowance (25%), House Rent Allowance (15%), and Provident Fund (8.33%) on the basic pay. It then computes the net pay and gross pay accordingly.
Read more
|
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 |
This Java program determines the nature of the roots of a quadratic equation based on the discriminant value. It takes the coefficients � a, � b, and � c as input and calculates the discriminant to check if the roots are real and unequal, real and equal, or imaginary.
Read moreax² + bx + c = 0, and d = b2 – 4*a*c,
|
Value of discriminates |
Nature |
|
d>0 |
Roots are real and Unequal |
|
d=0 |
Roots are real and Equal |
|
d<0 |
Roots are Imaginary |
Write a program to determine the nature of the roots of a quadratic equation by taking a, b, and c as input.
Read AnswerThis Java program checks whether a triangle is possible based on the lengths of its three sides. It uses the triangle inequality theorem, which states that the sum of any two sides must be greater than the third side.
Read moreRead Answer
This Java program accepts three numbers from the user and checks whether they form a Pythagorean Triplet using the condition � 2 = � 2 + � 2 c 2 =a 2 +b 2 , where � c is the largest number. The program displays an appropriate message based on the result.
Read moreRead Answer