Q. Write a program to take the monthly salary from the user, find and display income tax with the help of the following slab:
Monthly Salary Income Tax
8000 or less Nil
8000-9000 20% of Monthly salary
9000-10000 30% of Monthly salary
10000 or above 40% of Monthly salary
Q. A salesman earns a commission on the value of his sales as per the following table.
Value of sales(Rs.) Commission(%)
1 – 999 1
1000 – 9999 5
10000 – 99999 10
Write a program to calculate and print the commission using sale value as input. The program is to keep on calculating the commission for various salesmen until a sales value zero is input.
Q. A company wants to set target for each of the four regions (EAST, WEST , NORTH and SOUTH). The company allots the following percentage target for each region.
East 15%
West 25%
North 30%
South 30%
Write a program to pass through command line parameters, the total target amount proposed by the company and print out the breakup of the target for each region.
Q. Write a program to find the car bill for a particular tourist.
Type of car Distance Charge Driver.
Maruti < = 100 Rs.800 Rs.100.
>100 & < = 200 Rs.800+Rs10/km Rs 300.
above 100
>200 Rs.15per km Rs 500
Sumo < = 100 Rs.600 Rs 100.
>100 & < = 200 Rs.600+Rs.8/km Rs 300
above 100
> 200 Rs.12 per km Rs.500
Q. Write a program using method to calculate the salary increment of employees based on their basic pay. Calculate the final salary after increment.
Basic Pay Rise
10700/- 550/-
12500/- 750/-
15000/- 1050/-
Q. Write a program using the this keyword, to calculate the prize amount for a cricketer depending upon his text average. Use the following date.
Test Average Graduate Prize Amount
> = 80 A Rs. 1,00,000.00
80> & > = 65 B Rs. 50,000.00
50> & > = 40 C Rs. 25,000.00
<40 D Rs. 10,000.00
Q. Using if-else statements write a program in java to calculate the grade as per the given criteria:
Marks Grade
> = 80 and <100 Excellent
> = 70 and <80 First Div.
> = 60 and <70 Second Div.
> = 50 and <60 Third Div.
Less than 50 Fail
Q. Write a program to assign values the variable basic salary and calculate the DA and the gross salary and print them. The DA is calculated as per the rules given below:
if basic< 2000 then DA is 5% of basic
if basic> = 2000 & <7000 then DA is 8% of basic
if basic> = 7000& <10000 then DA is 10% of basic
if basic> = 10000 then DA is 12% of basic
Gross Salary = Basic + DA.
Q. There are 55 employees in an organization. You have to display the number of employees getting Net-Salary above 20000 by taking only Basic_Salary as input and following the table given below.
Basic Salary DA (% Basic_salary) IT (% Gross_Salary)
Below 5000 8% 6%
5000 to < 10000 15% 9%
10000and above 18% 12%
Where DA and IT are Dearness Allowance and income Tax respectively.
Gross_Salary = Basic_Salary + DA
Net_Salary = Gross_Salary – IT
Q. Calculate and display the traveling allowance for 50 employees of an organization by taking distance traveled as input. The organization gives traveling allowance according to the following table.
Distance Amount.
< = 20 Rs 200
>20 and < = 50 Rs 200 + Rs 5 per extra km above 20
>50 and < = 100 Rs 500 + Rs 5 per extra km above 50.
>100 Rs 15 per km.
Q. Commission according to the following tables:
Sale (in Rs.) Commission(% of sale)
8000 or less Nil
8000 – 9000 12%
9000 – 10000 15%
10000 or above 18%
apart from this each salesman gets a fixed allowance of Rs 550 and also a bonus of Rs 500 if a salesman achieves the target of 10000. Display the total income of each salesman along with the sales. Also display the number of salesman having income of 5000 or above.
Q. A company has 120 employees who are divided into four grades as follows:
Grade Basic( Rs. per month) D.A.(% of Basic) H.R.A.(% of Basic)
1 10,000 or more 40% 30%
2 5,000 – 10,000 40% 25%
3 < 5,000 but > 2,000 30% 20%
4 2,000 or less 30% 15%
If the salary which is the total of Basic, D.A., and H.R.A., is above Rs.50,000 per month then Income Tax at the rate of 30% of the annual salary exceeding 50,000 is deducted on monthly basis at source. Taking name of the employees and the Basic(monthly) pay as inputs, a pay slip, which contains Name, Basic monthly pay, DA, HRA, Monthly Income Tax and Net Monthly Salary, for each employee is to be printed. Write a java program to perform this job.
Q. Define class calcComm with member variables: sales, commission
method:
void acceptsales() to accept sales value
float commAmt() to calculate and return commission amount.
the commission will be calculated according to the following criteria
sales commission rate
above or equal to 5000 15%
above or equal to 3000 but below 5000 10%
above or equal to 1000 but below 3000 5%
below 1000 2%
Q. Define class calculateBill having member variable: calls, charge
Member methods:
void calCharge(int type) to calculate the telephone bill.
Type is type of connection
1. For domestic
2. For business
Bill will be calculated according to the following rule-
Monthly rent – Rs. 450
Number of call free – 100
Next 150 calls – Rs. 1/call
Next 100 calls – Rs. 1.50/call
Extra calls – Rs. 2/call
for business type connection Rs 50/- will be paid extra by the customer
void display() to show the bill amount
Write main program to accept no. of calls and display menu
1. Domestic Connection
2. Business Connection
Enter Your Choice (1 or 2)
Bill will be calculated according to the option entered by the user and then finally display the bill.
Q. Write a program to calculate monthly telephone bill for a consumer after accept number of call according to given criteria.
Monthly rent Rs 400/-
No. of free calls 100
for next 150 calls Rs. 1.25/call
for extra calls Rs. 1.50/call
Q. Write a program to input the sales or any 20 sales men. Calculate and print the commission with an added allowance of Rs. 500. The commission can be calculated by using the following table:-
Sales Commission
Upto 5000 nil
5001-8000 10%
8001-10,000 12%
10,001 Or more 15%
Q. Write a Java program to accept an amount from the user and hence
find in each case:-
a) No of Rs. 100 notes and the remainder amount.
b) No of Rs. 50 notes and the remainder amount.
c) No of Rs. 20 notes and the remainder amount.
d) No of Rs. 10 notes and the remainder amount.
Eg. In Rs. 542; No of Rs. 100 = 5, Remainder = Rs. 42
No of Rs. 50 = 10, Remainder = Rs. 42
No of Rs. 20 = 27, Remainder = Rs. 2.
No of Rs. 10 = 54, Remainder = Rs. 2.
Q. A class namely student has three data member Name, roll and Marks of 5 Subjects the steam is assigned based on the following criteria :
Avg. Marks Stream
90% and above science with computers
80% ___89% science without Computers
70%____79% commerce with Maths
60%___69% commerce without Maths
Write a program to declare a class student and allot the stream and print them.
Q. ABC stand decided to take charge for the parking of 2wheeler, 3wheeler and 4wheller (same charges) as per the following criteria:
No. of Hrs. Parked Charge
upto 8 hrs Rs 10
next 8 hrs Rs. 6 for additional 8 hours
above 16 hours Rs. 5 for each addition 8 hrs.
Input number of hours parked and prints the charges as per given criteria.