Çë¸÷λ¸ßÊÖ²»Áߴͽ̣¬JAVA³ÌÐòÎÊÌâ
×ܹ²Á½¸öÎļþTaxTest.javaÓëTax.java
---------------------------------------------------------------------------------------
TaxTest.java
===========================================
import javax.swing.JOptionPane;
public class TestTax{
public static void main(String[] args){
String yearString = JOptionPane.showInputDialog("Enter the year ,etc 2001 or 2002");
int year = Integer.parseInt(yearString);
Tax change = new Tax();
change.setBrackets(year);
change.setRates(year);
int[][] brackets = change.getBrackets();
double[] rates = change.getRates();
double taxableIncome = change.getTaxableIncome();
double tax = 0;
System.out.println(year + " year Ameica duty of four persons");
System.out.println("-----------------------------------------------------");
System.out.println("taxableIncome SINGLE_FILER MARRIED_JOINTLY MARRIED_SEPARATELY HEAR_OF_HOUSHOLD");
System.out.println("-----------------------------------------------------");
for(double i = taxableIncome;i <= 60000;){
System.out.println(taxableIncome );
for(int filingStatus = 0;filingStatus <= 3;filingStatus ++){
if(taxableIncome <= brackets[filingStatus][0])
tax = taxableIncome * rates[0];
else tax = brackets[filingStatus][0] * rates[0];
for(int j = 1;j < brackets[0].length;j ++){
if(taxableIncome < brackets[filingStatus][j])
tax += (brackets[filingStatus][j]-brackets[filingStatus][j-1])*rates[j];
else tax += (taxableIncome -brackets[filingStatus][j-1])*rates[j];
}
System.out.println(" " + tax);
}
taxableIncome += 1000;
System.out.println();
}
System.out.println("-----------------------------------------------------");
}
}
Tax.java
=============================================
public class Tax{
private int filingStatus = 0;
private int[][] brackets;
private double[] rates;
private double taxableIncome;
publ
Ïà¹ØÎĵµ£º
1¡¢length() ×Ö·û´®µÄ³¤¶È
¡¡¡¡Àý£ºchar chars[]={'a','b'.'c'};
¡¡¡¡¡¡¡¡String s=new String(chars);
¡¡¡¡¡¡¡¡int len=s.length();
2¡¢charAt() ½ØÈ¡Ò»¸ö×Ö·û
¡¡¡¡Àý£ºchar ch;
¡¡¡¡¡¡¡¡ch="abc".charAt(1); ·µ»Ø'b'
3¡¢getChars() ½ØÈ¡¶à¸ö×Ö·û
¡¡¡¡void getChars(int sourceStart,int sourceEnd,char tar ......
¹ØÓÚJavaÕ»Óë¶ÑµÄ˼¿¼
1. Õ»(stack)Óë¶Ñ(heap)¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
¡¡¡¡2. Õ»µÄÓÅÊÆÊÇ£¬´æÈ¡ËٶȱȶÑÒª¿ì£¬½ö´ÎÓÚÖ±½ÓλÓÚCPUÖеļĴæÆ÷¡£µ«È±µãÊÇ£¬´æÔÚÕ»ÖеÄÊý¾Ý´óСÓëÉú´æÆÚ±ØÐëÊÇÈ·¶¨µÄ£¬È±·¦Áé»îÐÔ¡£ÁíÍ⣬ջÊý¾Ý¿ÉÒÔ¹²Ïí£¬Ïê¼ûµÚ3µ ......
java¼¯ºÏ¿ò¼Üͼ¼°½éÉÜ
ת×Ô:http://hi.baidu.com/%C9%AE_%CC%C6/blog/item/9e2a8b0887008a8ad0581b3d.html
¼ò»¯Í¼£º
Javaƽ̨ÌṩÁËÒ»¸öȫеļ¯ºÏ¿ò¼Ü¡£“¼¯ºÏ¿ò¼Ü”Ö÷ÒªÓÉÒ»×éÓÃÀ´²Ù×÷¶ÔÏóµÄ½Ó¿Ú×é³É¡£²»Í¬½Ó¿ÚÃèÊöÒ»×鲻ͬÊý¾ÝÀàÐÍ¡£
Java 2¼¯ºÏ¿ò¼Üͼ
¼¯ºÏ½Ó¿Ú£º6¸ö½Ó¿Ú£¨¶ÌÐéÏß±íʾ£©£¬±íʾ²»Í ......
1£ºÓÃhttpÐÒéÉÏ´«¸üÊʺÏweb±à³ÌµÄ·½±ã£»´«Ð¡ÓÚ1MÎļþËÙ¶ÈÒª±ÈÓÃftpÐÒéÉÏ´«ÎļþÂÔ¿ì¡£°²È«ÐԺ㻲»ÏñftpÄÇÑù£»±ØÐëÒªÆô¶¯Ò»¸öftp·þÎñ²ÅÐС£
2£ºÓÃftpÐÒéÉÏ´«Îļþ´óÓÚ1MµÄÎļþËٶȱÈhttp¿ì£»ÎļþÔ½´ó£»ÉÏ´«µÄËٶȾͱÈhttpÉÏ´«¿ìµÄ±¶ÊýÔ½´ó¡£¶øÇÒÓÃjava±àд³ÌÐò£»ftp±Èhttp·½±ã¡£ºÃ£¬·Ï»°ÉÙ˵£»ÎÒÃÇÏȴһ¸öʵÀýÀ´ÀíÐÔÈÏ ......