Personal income tax calculation

Source: Internet
Author: User

Personal income tax calculation
 PackageCom.kaige123.ifelse;/*** Edith * /  Public  class testifelse {Public   static void main(string[] args) {Java.util.Scanner input =NewJava.util.Scanner (system.in); System.out.print ("Please enter your salary:");intGZ = Input.nextint ();intSS =0; GZ-=3500;if(GZ >=0) {if(GZ < the) {//First level 0.3 0SS = (int) (GZ *0.03f);}Else{if(GZ <4500) {//TenSS = (int) (GZ *0.1f- the);}Else{if(GZ <9000) {//555SS = (int) (GZ *0.2f-555);}Else{if(GZ <35000) {//1005SS = (int) (GZ *0.25f-1005);}Else{if(GZ <55000) {//2755SS = (int) (GZ *0.30f-2755);}Else{if(GZ <80000) {//5505SS = (int) (GZ *0.35f-5505);}Else{SS = (int) (GZ *0.45f-13505);}}}}}} System.out.println ("All your taxes to be delivered:"+ SS +"Yuan"); System.out.println ("The rest of the salary:"+ (gz+3500-SS) +"Yuan");}Else{System.out.println ("Your salary is not within the income tax, come on!" ");}}}
Improve if Else
 PackageCom.kaige123.ifelse;/*** Edith * /  Public  class testifelse {Public   static void main(string[] args) {Java.util.Scanner input =NewJava.util.Scanner (system.in); System.out.print ("Please enter your salary:");intGZ = Input.nextint ();intSS =0; GZ-=3500;if(GZ >=0) {if(GZ < the) {//First level 0.3 0SS = (int) (GZ *0.03f);}Else if(GZ <4500) {//TenSS = (int) (GZ *0.1f- the);}Else if(GZ <9000) {//555SS = (int) (GZ *0.2f-555);}Else if(GZ <35000) {//1005SS = (int) (GZ *0.25f-1005);}Else if(GZ <55000) {//2755SS = (int) (GZ *0.30f-2755);}Else if(GZ <80000) {//5505SS = (int) (GZ *0.35f-5505);}Else{SS = (int) (GZ *0.45f-13505);} System.out.println ("All your taxes to be delivered:"+ SS +"Yuan"); System.out.println ("The rest of the salary:"+ (GZ +3500-SS) +"Yuan");}Else{System.out.println ("Your salary is not within the income tax, come on!" ");}}}

Personal income tax calculation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.