String Handling — Question 27
Back to all questionsQuestion 14
Given below is a hypothetical table showing rates of Income Tax for male citizens below the age of 65 years:
| Taxable Income (TI) | Income Tax Calculation |
|---|---|
| Does not exceed 1,60,000 | Nil |
| Is greater than 1,60,000 and less than or equal to 5,00,000 | ( TI - 1,60,000 ) * 10% |
| Is greater than 5,00,000 and less than or equal to 8,00,000 | ( (TI - 5,00,000 ) * 20% ) + 34,000 |
| Is greater than 8,00,000 | ( (TI - 8,00,000) * 30%) + 94,000 |
Write a program to input the age, gender (male or female) and Taxable Income of a person. If the age is more than 65 years or the gender is female, display "wrong category".
If the age is less than or equal to 65 years and the gender is male, compute and display the Income Tax payable as per the table given above.
import java.util.Scanner;
public class KboatIncomeTax
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter Gender(male/female): ");
String gender = in.nextLine();
System.out.print("Enter Age: ");
int age = in.nextInt();
System.out.print("Enter Taxable Income: ");
double ti = in.nextDouble();
double tax = 0.0;
if (age > 65 || gender.equalsIgnoreCase("female")) {
System.out.print("Wrong Category");
}
else {
if (ti <= 160000)
tax = 0;
else if (ti <= 500000)
tax = (ti - 160000) * 10 / 100;
else if (ti <= 800000)
tax = 34000 + ((ti - 500000) * 20 / 100);
else
tax = 94000 + ((ti - 800000) * 30 / 100);
System.out.println("Tax Payable: " + tax);
}
}
}Output


Key Concepts Covered
This question tests your understanding of the following concepts from the chapter String Handling: Question, Hypothetical, Table, Showing, Rates, Income. These are fundamental topics in Computer Applications that students are expected to master as part of the ICSE Class 10 curriculum.
A thorough understanding of these concepts will help you answer similar questions confidently in your ICSE examinations. These topics are frequently tested in both objective and subjective sections of Computer Applications papers. We recommend revising the relevant section of your textbook alongside practising these solved examples to build a strong foundation.
How to Approach This Question
Read the question carefully and identify what is being asked. Break down complex questions into smaller parts. Use the terminology and concepts discussed in this chapter. Structure your answer logically — begin with a definition or key statement, then provide supporting details. Review your answer to ensure it addresses all parts of the question completely.
Key Points to Remember
- Write programs with proper indentation and comments.
- Trace through your code with sample inputs to verify correctness.
- Explain the logic behind each step of your solution.
- Familiarise yourself with common library functions and methods.
Practice more questions from String Handling — Computer Applications, Class 10 ICSE