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

CS Core3

The document outlines programming tasks in Java, requiring the implementation of various classes and functions. Key tasks include creating an 'employee' class to calculate tax based on income, reversing the case of letters in a string, sorting city names using Bubble Sort, and checking if a number is a Palindrome or Perfect number. Each task emphasizes clear variable descriptions and logical programming structure.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

CS Core3

The document outlines programming tasks in Java, requiring the implementation of various classes and functions. Key tasks include creating an 'employee' class to calculate tax based on income, reversing the case of letters in a string, sorting city names using Bubble Sort, and checking if a number is a Palindrome or Perfect number. Each task emphasizes clear variable descriptions and logical programming structure.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SECTION B

Attempt any four questions from this section.


The answer in this section should consist of the programs in either BlueJ environment or any program
environment with Java as the base. Each program should be written using Variable
description/Mnemonic codes such that the logic of the program is clearly depicted.

Ques 4. Define a class employee having the following description:- 15


Data members / int pan to store personal account number
Instance variables String name to store name
double taxincome to store annual taxable income
double tax to store tax that is calculated
Member functions:
input( ) Store the pan number, name, taxableincome
calc( ) Calculate tax for an employee
display( ) Output details of an employee

Write a program to compute the tax according to the given conditions and display the output
as per given format.

Total Annual Taxable Income Tax Rate


Upto Rs 1,00,000 No tax
From 1,00,001 to 1,50,000 10% of the income exceeding Rs 1,00,000
From 1,50,001 to 2,50,000 Rs 5000 + 20% of the income exceeding Rs 1,50,000
Above Rs 2,50,00 Rs 25,000 + 30% of the income exceeding Rs 2,50,000

Output:
Pan Number Name Tax-income Tax
- - - -
- - - -
- - - -

Ques 5. Write a program to input a string and print out the text with the uppercase and lowercase 15
letters reversed, but all other characters should remain the same as before.

Example : INPUT : WelComE TO School


OUTPUT : wELcOMe to sCHOOL

Ques 6. Define a class and store the given city names in a single dimensional array. Sort these names 15
in alphabetical order using the Bubble Sort technique only.

INPUT : Delhi, Bangalore, Agra, Mumbai, Calcutta


OUTPUT : Agra, Bangalore, Calcutta, Delhi, Mumbai

Ques 7. Write a menu driven class to accept a number from the user and check whether it is 15
Palindrome or a Perfect number.
(a) Palindrome number – ( a number is a Palindrome which when read in reverse order is
same as read in the right order ) Example : 11, 101, 151 etc.

(b) Perfect number - ( a number is called Perfect if it is equal to the sum of its factors
other than the number itself. ) Example : 6 = 1 + 2 + 3

You might also like