java

Write a program to input income and calculate tax on different percentage depending upon income and print it. (JAVA)

Write a program to input income and calculate tax on different percentage depending upon income and print it. (JAVA)
Income                                  tax
below 250000                  0%
250000 – 500000          5%
500000 – 1000000       20%
above 1000000               30%

java

/* 
Write a program to input income and calculate tax on different percentage depending upon income and print it. (JAVA)
income              tax
below 250000        0%
250000 - 500000     5%
500000 - 1000000    20%
above 1000000       30%
*/

package com.company;

import java.util.Scanner;

public class TaxCalculator
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);

System.out.println("INPUT YOUR INCOME : ");
int income = sc.nextInt();

int taxP =0;

if ( income >= 250000 && income <= 500000 )
{
taxP = 5;
}
else if ( income >= 500000 && income <= 1000000 )
{
taxP = 20;
}
else if ( income > 1000000 )
{
taxP = 30;
}

System.out.println("YOU ARE UNDER : " + taxP + "% TAX BRACKET");
double tax = 0;
tax = (taxP * income)/100;

System.out.println("Tax to be paid is :" + tax );

}
}


Thanks Dosto for Reading this blog.

I think you all are definitely thinking of being connected with me.

Are you??
Yaa I know no-one is here but then also I provide my all social media links of my Digital Creation Tech DCode and my personal handles.
🧑‍💻🧑‍💻 Social Media Links of Tech DCode :

👉🏻 Instagram : https://www.instagram.com/thetechdcode/
👉🏻 Facebook Page : https://www.facebook.com/thetechdcode
👉🏻 Twitter : https://twitter.com/thetechdcode
👉🏻 Telegram Channel : https://t.me/thetechdcode
👉🏻 YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
👉🏻 Tech DCode Linktree : https://linktr.ee/thetechdcode
👉🏻 My Personal Handles : https://linktr.ee/virtualshivamin

 

🧑‍💻🧑‍💻 Social Media Links of SHIVAM SINGH (OWNER) :
👉🏻 Instagram : https://www.instagram.com/virtualshivamin/
👉🏻 Facebook Page : https://www.facebook.com/virtualshivamin/
👉🏻 Twitter : https://twitter.com/virtualshivamin/
👉🏻 Personal Linktree : https://linktr.ee/virtualshivamin

🤟🤘 Check Best Offers/Deals and Discount on Amazon :
👉 Amazon : https://amzn.to/3tLt2FN
👉 Bestsellers : https://amzn.to/31boSuB
👉 New Realeases : https://amzn.to/3rdru5U
👉 Movers and Shakers : https://amzn.to/3lFu5nY
👉 Computer and accessories : https://amzn.to/3lERTbJ
👉 Electronics : https://amzn.to/3sqHW4l
👉 Softwares : https://amzn.to/3ccwAee

Leave a Reply

Your email address will not be published. Required fields are marked *