close
10095

JAVA作業的問題

1.下面哪些是有效的識別字(1)artist (2) #never (3) ChinaTimes (4) Y2k(5) 8cats (6) pentium4 (7) 2046 (8) TOMBO(9) A1234 (10) _ten (11) jdk1_5 (12) 2_cugii(13) a pen (14) println (15) news# (16) NO135(17) BBB (18) _AMD (19) Christmas (20) web2.請試著爲符合下列描述的變數名稱命名 :(a) 某學生的名字(b) 學生的成績(c) 圓的半徑(d) 圓的面積3.下列何者是錯誤的常數 ? 為什麼 ?(1)8x (2) 6M (3) 58.64 (4) k7(5)$10095 (6) 847 (7) 38L (8) 16.17F4.假設浮點數變數f的值為6235.748f

整數變數 i 的值為13

試撰寫一程式

將兩個變數值相加 ( f i )與相除 ( f/i ) 後印出其結果5.設下列各運算式中

a的初值皆為10

b的初值皆為5

再不需強制轉換資料型態的情況下

試寫出下列各式中

經運算過後的a 與 b 之值 :(1)b*= a(2)a/= b (3)a/= b(4)a%= --b(5)b%= a
A1:artist、 ChinaTimes、Y2k、 pentium4 、TOMBO、A1234、 _ten、 jdk1_5、NO135、BBB 、_AMD、Christmas、 println、webA2:(a) student_name (b) student_score (c) circular_radius (d)circular_areaA3:a、b、d、e錯 原因→不能有數字以外的字元A4:public class ggg{ public static void main(String args[]) { float f=6235.748f; int i=13; System.out.println(f

arrow
arrow

    10401 發表在 痞客邦 留言(0) 人氣()