Size: px
Start display at page:

Download ""

Transcription

1 CreW Project

2

3 I HCP HCP (1)

4

5 1 ² ² ² " "

6 2 0 IT Java 5 10 Java?? " " ² ² ²

7 3 2 HCP

8

9 I

10

11 7 1 ² { { { ² HCP ² { { 1.1 ( 1 2) 1: 1: public class AddTwoNumberSample f 2: 3: public static void main(string[] args) f 4: int a, b, c; 5: a = Input.getInt(); 6: b = Input.getInt(); 7: c = a + b; 8: System.out.println(c); 9: g 10: 11: g

12 8 1 2: 1: /** 2: * 3: * 4: * 5: * 6: * 7: Manabu Sugiura 8: $Id: AddTwoNumberApplication.java,v /05/20 12:24:47 duskin Exp $ 9: */ 10: public class AddTwoNumberApplication f 11: 12: public static void main(string[] args) f 13: AddTwoNumberApplication addtwonumberapplication = 14: new AddTwoNumberApplication(); 15: addtwonumberapplication.main(); 16: g 17: 18: void main() f 19: 20: int firstnumber; // 21: int secondnumber; // 22: int result; // 23: 24: // 25: System.out.println(" "); 26: System.out.println(" 2 0 "); 27: 28: // 29: System.out.print(" >>"); 30: System.out.flush(); 31: firstnumber = Input.getInt(); 32: 33: // 34: System.out.print(" >>"); 35: System.out.flush(); 36: secondnumber = Input.getInt(); 37: 38: // 39: while (firstnumber!= 0 secondnumber!= 0) f // 40: 41: // 42: result = firstnumber + secondnumber; 43: 44: // 45: System.out.println(" " + result + " "); 46: 47: // 48: System.out.print(" >>"); 49: System.out.flush(); 50: firstnumber = Input.getInt(); 51: 52: // 53: System.out.print(" >>");

13 : System.out.flush(); 55: secondnumber = Input.getInt(); 56: g 57: 58: // 59: System.out.println(" "); 60: g 61: g ²

14 No 3: 1: public class Example f 2: 3: public static void main(string[] args) f 4: Example example = new Example(); 5: example.main(); 6: g 7: 8: void main()f 9: int a = 49; 10: int b = 73; 11: int c = 100; 12: int d = 45; 13: int e = 25; 14: double x = a + b + c + d + e; 15: double y = x / 5.0; 16: y = y * 10; 17: if((y % 10) >= 5)f 18: y = y + 10; 19: g 20: int z = (int)(y / 10); 21: System.out.println(z); 22: 23: g

15 Java " " package, import Java fg public class [ ]f g ( ) Java.java Sample.java public static void main(string args[]) 4 2 public static void main(string[] args)f [ ] [ ] = new [ ](); [ ].main(); g

16 12 1 void main() 2 main() 1 ( ) void main()f g ( ) 1 public static void main(string[] args) public static void main(string[] args) main() 4

17 : 1: public class Example f 2: 3: public static void main(string[] args) f 4: Example example = new Example(); 5: example.main(); 6: g 7: 8: void main() f 9: 10: int a = 49; 11: int b = 73; 12: int c = 100; 13: int d = 45; 14: int e = 25; 15: 16: double x = a + b + c + d + e; 17: double y = x / 5.0; 18: 19: y = y * 10; 20: if ((y % 10) >= 5) f 21: y = y + 10; 22: g 23: int z = (int) (y / 10); 24: 25: System.out.println(z); 26: g 27: g ( 1.1) Java fg Java ( 1.2) TAB TAB 1 2

18 / % % 14 1!#"%$ &'( )$*)+,.- / 1.1:! "$# 1.2: ( 1.3)! "$#%!& ' (*)+),-$#.!/10 /32 4#.!& 5 ' 687:9;)<' 687=/>),?#.!/@ A CB=7D EF G7HJILKM' 6N7% 6 )+9H/< 1.3:

19 Java a bbb 5: 1: public class ScoreAdministratorSample f 2: 3: public static void main(string[] args) f 4: ScoreAdministratorSample scoreadministratorsample = 5: new ScoreAdministratorSample(); 6: scoreadministratorsample.main(); 7: g 8: 9: void main() f 10: 11: int japanese = 49; 12: int mathematics = 73; 13: int science = 100; 14: int civics = 45; 15: int english = 25; 16: 17: double total = japanese + mathematics + science + civics + english; 18: double average = total / 5.0; 19: 20: average = average * 10; 21: if ((average % 10) >= 5) f 22: average = average + 10; 23: g 24: int result = (int) (average / 10); 25: 26: System.out.println(result); 27: g 28: g Java Java 2 2

20 16 1 ² { { TicketReserveApplication TicketReserveApplication.java ² { { getcurrenttime ² { { familyname

21 : 1: public class ScoreAdministratorSample f 2: 3: public static void main(string[] args) f 4: ScoreAdministratorSample scoreadministratorsample = 5: new ScoreAdministratorSample(); 6: scoreadministratorsample.main(); 7: g 8: 9: void main() f 10: // 11: int japanese = 49; // japanese 12: int mathematics = 73; // mathematics 13: int science = 100; // science 14: int civics = 45; // civics 15: int english = 25; // english 16: 17: // total 5 average 18: double total = japanese + mathematics + science + civics + english; 19: double average = total / 5.0; 20: 21: //average : average = average * 10; 23: if ((average % 10) >= 5) f // 5 24: average = average + 10; //10 25: g 26: // result 27: int result = (int) (average / 10); 28: 29: // result 30: System.out.println(result); 31: g 32: g

22 Java /* */ /* */ Java Javadoc /** * /** * Java */ // int x;// ( 6) ²

23 //average average = average * 10; if ((average % 10) >= 5) f // 5 average = average + 10; //10 g ² // average = average * 10; if ((average % 10) >= 5) f // average = average + 10; // g int result = (int) (average / 10); 7 7: 1: /** 2: * 3: * 4: * 5: * 6: Manabu Sugiura 7: $Id: ScoreAdministratorSample.java,v /08/08 13:15:50 duskin Exp $ 8: */ 9: public class ScoreAdministratorSample f 10: 11: public static void main(string[] args) f

24 : ScoreAdministratorSample scoreadministratorsample = 13: new ScoreAdministratorSample(); 14: scoreadministratorsample.main(); 15: g 16: 17: void main() f 18: 19: // 20: int japanese = 49; // 21: int mathematics = 73; // 22: int science = 100; // 23: int civics = 45; // 24: int english = 25; // 25: 26: // 27: double total = japanese + mathematics + science + civics + english; 28: // 29: double average = total / 5.0; // 30: 31: // 32: average = average * 10; 33: if ((average % 10) >= 5) f // 34: average = average + 10; // 35: g 36: int result = (int) (average / 10); 37: 38: // 39: System.out.println(result); 40: g 41: g ² ( )

25 W ² ( 1.4) "!#%$ '& ( *),+-/ (4),( 3%1 & 3 -)53% (8), &9:;1 (. < = 486 EF 9'4 *,G H I < 7 JAKML Q RSL 867 EF 9'*,86 EF 9'4TVU I < 1 XZY[YF6 EF 9'4\VU I]"^ G8]`_` a Dbdc efgmh 86: EF 9'4i86 Ej 9'*)VU I < %kmlzf nj o 1 &8pE[ ( % qiy1 &r ] Yj86 Ej 9' U I'] < sojp QMR tvus Dw xld y:z (r + H 'r H $'Eq1 &r{ &Y[EF ('% ] < 1.4: ²

26 ² { { { { HCP NTT HCP (Hierarchical and Compact Description Chart ) HCP HCP 1.5 HCP

27 1.3 23! " # $"# % & ''"# $'& ($ )*+,-/ ;: '<=$ 1.5: HCP HCP HCP ( 1.5) ( 7) HCP HCP

28 " " 1.6: 1.6 GUI CUI {Application HCP 1.7 8!#" $%'& () * +,.- + ()!#"/1032, '8:9 1.7: HCP

29 : 1: /** 2: * 3: * 4: Manabu Sugiura 5: $Id: GreetingApplication.java,v /05/04 16:25:14 macchan Exp $ 6: */ 7: public class GreetingApplication f 8: 9: public static void main(string[] args) f 10: GreetingApplication greetingapplication = new GreetingApplication(); 11: greetingapplication.main(); 12: g 13: 14: void main() f 15: 16: String name; // 17: 18: // 19: System.out.println(" "); 20: 21: // 22: System.out.println(" "); 23: System.out.print(">>"); 24: System.out.flush(); 25: name = Input.getString(); 26: 27: // 28: System.out.println(" " + name + " "); 29: System.out.println(" "); 30: 31: // 32: System.out.println(" "); 33: g 34: g 2

30 "!#%$'&)( * +, 2 "-.$/0 + 1 ' , "!#%$98 :<; = >.?@ 'ACBED 1.8: HCP

31 : 1: /** 2: * 3: * 4: * 5: * 6: Manabu Sugiura 7: $Id: GreetingApplication.java,v /05/04 20:30:23 gackt Exp $ 8: */ 9: public class GreetingApplication f 10: 11: public static void main(string[] args) f 12: GreetingApplication greetingapplication = new GreetingApplication(); 13: greetingapplication.main(); 14: g 15: 16: void main() f 17: 18: String name; // 19: 20: // 21: System.out.println(" "); 22: 23: // 24: System.out.println(" "); 25: System.out.print(">>"); 26: System.out.flush(); 27: name = Input.getString(); 28: 29: // 30: while (name.length()!= 0) f 31: 32: // 33: System.out.println(" " + name + " "); 34: System.out.println(" "); 35: 36: // 37: System.out.println(" "); 38: System.out.print(">>"); 39: System.out.flush(); 40: name = Input.getString(); 41: g 42: 43: // 44: System.out.println(" "); 45: g 46: g

32 while while while while ( [ ] ) f g ( ) 1.9 HCP 1.10 F8G CED CED >@?BA >E?BA "!$# % &')(*+,-/. * :9<;<10= F8G HJI HJI 1.9: while

33 : HCP ( 10) 0 ² 2 0 ² 0 0

34 C C D D 30 1 "!$#"%'& (*) +,' " -$. / bdcfe 6cfe A g Y A g Y UWVYX %Z U[VYX %Z G'\ 0$ :9;/<=.>?<A@3B3 24?5E-17F9HGAI.J3K L M %"NPORQ"%"S /T " 0$] /^3_`aT :"!$#'%"&:(h) 1 U[V 6ij`k6 /l\nm3 1.11: HCP 10: 1: /** 2: * 3: * 4: * 5: * 6: * ( ) 7: * 8: Manabu Sugiura 9: $Id: DivideTwoNumberApplication.java,v /05/04 20:29:51 gackt Exp $ 10: */ 11: public class DivideTwoNumberApplication f 12: 13: public static void main(string[] args) f 14: DivideTwoNumberApplication dividetwonumberapplication = 15: new DivideTwoNumberApplication(); 16: dividetwonumberapplication.main(); 17: g 18: 19: void main() f

35 : 21: int firstnumber; // 22: int secondnumber; // 23: int result; // 24: 25: // 26: System.out.println(" "); 27: System.out.println(" "); 28: 29: // 30: System.out.println(" "); 31: System.out.print(">>"); 32: System.out.flush(); 33: firstnumber = Input.getInt(); 34: 35: // 36: System.out.println(" "); 37: System.out.print(">>"); 38: System.out.flush(); 39: secondnumber = Input.getInt(); 40: 41: // 42: while (firstnumber!= 0 secondnumber!= 0) f 43: 44: // 45: if (secondnumber == 0) f // 46: System.out.println("!"); 47: break; // 48: g 49: 50: // 51: result = firstnumber / secondnumber; 52: System.out.println(" " + result + " "); 53: 54: // 55: System.out.println(" "); 56: System.out.print(">>"); 57: System.out.flush(); 58: firstnumber = Input.getInt(); 59: 60: // 61: System.out.println(" "); 62: System.out.print(">>"); 63: System.out.flush(); 64: secondnumber = Input.getInt(); 65: g 66: 67: // 68: System.out.println(" "); 69: g 70: g

36 HealthCareSample.java 3 AddTwoNumberApplication.java

37 33 2 (1) ² ² ² ² HCP ( 2.1) 1,2,3 2.2

38 H I 34 2 (1) "! #"$&% ')( +*-, " "]_^a` $ 021 b +./ / : ;< 5 =" "]c^ `$ b >@?A $6B)C3D 3E7FG >J?7A $ BLK&M N O2P Q K <&RTSU:/ 4 "! #"$&% ')( O >J?V WX Y 3Z M\[ 2.1: HCP! " # $&%(' 2.2:

39 v w ,2,3 HCP :98;< Q8RDS3TDUWV8XZY I\[^] 98;< RDŠŒ Ž 7U Ia_a` 9bLONP;D< E\FHGJI_a` 9bLONP;< c FHGJI_a` 9bLONP;< KAI L^NP9fe\gOh8ij => d I BC9J;< RDŠ 5 U IWK 9:LONP;D<,-/. 0! " $#%!&(') *! " $#%!&(' EFHGJIK 9MLONP;< kmlpn U7oqpbr <bspt7u< kmlfn U7o%xWy z x c KAIaK7{a 7} jd~ h ;< FHGJIK 9MLONP;< =7> 9:?A@;< =7> 9:BCD;< Q8RDS3TDUWV8XZY { k/lf 3ƒ 5 9b y ˆ < 2.3: HCP

40 36 2 (1) 11: 1: /** 2: * 3: * 4: * 5: * 6: * 7: macchan 8: $Id: JankenApplication.java,v /05/04 20:54:13 gackt Exp $ 9: */ 10: public class JankenApplication f 11: 12: public static void main(string[] args) f 13: JankenApplication jankenapplication = new JankenApplication(); 14: jankenapplication.main(); 15: g 16: 17: void main() f 18: 19: String playernamea; // A 20: String playernameb; // B 21: int playerhanda; // A 22: int playerhandb; // B 23: int i; // 24: 25: // 26: System.out.println(" "); 27: System.out.println(" A "); 28: 29: // A 30: System.out.println(" A "); 31: System.out.print(">>"); 32: System.out.flush(); 33: playernamea = Input.getString(); 34: 35: // B 36: System.out.println(" B "); 37: System.out.print(">>"); 38: System.out.flush(); 39: playernameb = Input.getString(); 40: 41: // 42: while (true) f 43: 44: // A 45: System.out.println(playerNameA + " "); 46: System.out.println("1., 2., 3. (0. )"); 47: System.out.print(">>"); 48: System.out.flush(); 49: playerhanda = Input.getInt(); 50: 51: // 52: if (playerhanda == 0) f // 53: break; //

41 : g 55: 56: // 57: i = 0; 58: while (i < 100) f 59: System.out.println(); 60: i = i + 1; 61: g 62: 63: // B 64: System.out.println(playerNameB + " "); 65: System.out.println("1., 2., 3. "); 66: System.out.print(">>"); 67: System.out.flush(); 68: playerhandb = Input.getInt(); 69: 70: // 71: if (playerhanda == 1 && playerhandb == 2) f // VS 72: System.out.println(playerNameA + " "); 73: g else if (playerhanda == 1 && playerhandb == 3) f // VS 74: System.out.println(playerNameB + " "); 75: g else if (playerhanda == 2 && playerhandb == 1) f // VS 76: System.out.println(playerNameB + " "); 77: g else if (playerhanda == 2 && playerhandb == 3) f // VS 78: System.out.println(playerNameA + " "); 79: g else if (playerhanda == 3 && playerhandb == 1) f // VS 80: System.out.println(playerNameA + " "); 81: g else if (playerhanda == 3 && playerhandb == 2) f // VS 82: System.out.println(playerNameB + " "); 83: g else if (playerhanda == playerhandb) f // 84: System.out.println(" "); 85: g else f // 86: System.out.println(" "); 87: g 88: g 89: 90: // 91: System.out.println(" "); 92: g 93: g playerhanda playerhandb 1,2, " " ( 1) ( playerhand)

42 " ' ) ( 38 2 (1) #$&%!! * +-,/ : 1 HCP ( 2.3) HCP HCP

43 V & ' V >9?; = %'& ( )+*,.-/(10"*32 "!$# 8:9<; = %1& (4)+*,5-6(10"*2 %1& (4)+*,5-6(10"*'7 2.5: = = 2.6 QSRWT ;B< =>@?BADCE=GFH?J ;B< =>@?BADCE=GFH?I "!$# % (*),+,-/ ,: QSRUT ;< =>@?BADCE=GFH?J K@LNMPO ;< =>@?BADCE=GFH?I 2.6:

44 & & & & & & & & & B J J J J & J & & D 40 2 (1) '2D3E5 FGH %IJGFKL MDNPO "! #%$'&(*)+#",-&0 "! #%$'&(*)+#",-&/.! #9$'&:(<;+#>=9?0! #9$'&:(<;+#>=9?/. 1" '24365 C/C 2.7: ')(+*,.-)/ ;: /<032 $ % $ "#! "$#% "#! "$# $ > $ = $! $! "?# ;547698;: /<032 $ E G $ E G "#% G "# < ;< L?L $ < >< $ A 7 ;<! G < B E =< K $ C "$# K!B F ;< C E $ C "?# Ḧ 7 A E ; $!B "?# G A E $ ḦIF "?# < ;!B F ; $!B "$# A C "?# ; ḦI "?# $ B "# ;< K "# $ Ḧ "?#!B "$# "?#G A "?# B "# $ "?# $ B "# & 8 DMNOL?LPQSR=TVU;WX L L 2.8:

45 i &687 9 " # )*$('! #$&%(' +,.-/0213" +,.-/021+! 5&687 9 : ;+ 3" #)*$(' : ;+ +! #<$&%(' +,;-/ 021 " +,;-/ 021! 4A B 2.9: if if if ( [ ] ) f // (true) g else f g // (false) if else else

46 42 2 (1) 2.10: if if else if ( [ 1] ) f // 1 (true) g else if( [ 2] )f g else f g // 2 (true) // 1 2 (false) HCP : if HCP

47 ² Java (boolean) true false while if true false ² 2.1: Java A,B == A==B A B true!= A!=B A B true > A>B A B true < A<B A B true >= A>=B A B true <= A<=B A B true 2.2: Java A,B && A&&B A B true true jj AjjB A B true true

48 Q O P 44 2 (1) if if(playerhanda==1 playerhandb==2) 2.12! #" $%&(' 121 *,+.-0/ ' ) '(%:9 +3; '>= '(%:9 +3; ' < 5 -J+7 '(%LK +.M(N = 5 -J+7 '(%LK +.M(N <?GFH@ID?A@CBED RSR *,+3-4/ ' 2.12:

49 Java (int) -1, 0, 1, 2, 3 (String) " ", " " ( 2.13) -/.10 2! " # $% '&! + )* # $% '&( )* #*, /:87 3!;/<+7 -/.10 2! " # $% '&! + )* # $% '&( )* #*, = >? 2.13: Java 8 2 String Java String ( 12) 2 Java ( ) H

50 d 46 2 (1) egfh)i %jgkolutwvx g =!#"$&% ')(*,+-./ 0!2"$3% ' :<; 9 78 egfh)i %jgkolm!#" onp q 6sr `acb BEDZHIARFRy=z{J?D}HW~YET S?T@QC>ULONV?BCQ >@? ACBEDGFIHKJMLONP? BRQ J\YETU]^HIB@_ FI>IQR>RLONV? BCQ >U? ARBWDGFCHKJMXZYWJ[Q U U 2.14: HCP 12: 1: public class PriceTagApplication f 2: 3: public static void main(string[] args) f 4: PriceTagApplication pricetagapplication = new PriceTagApplication(); 5: pricetagapplication.main(); 6: g 7: 8: void main() f 9: 10: double consumptiontax = 0.05; // 11: int fixedprice; // 12: int discountprice; // 13: int taxincludedprice; // 14: int discountrate; // 15: 16: // 17: System.out.println(" "); 18: System.out.println(" "); 19:

51 : // 21: while (true) f 22: 23: // 24: System.out.println(" "); 25: System.out.print(">>"); 26: System.out.flush(); 27: fixedprice = Input.getInt(); 28: 29: // 30: if (fixedprice == 0) f // 31: System.out.println(" "); 32: break; // 33: g 34: 35: // 36: System.out.println(" "); 37: System.out.print(">>"); 38: System.out.flush(); 39: discountrate = Input.getInt(); 40: 41: // 42: discountprice = 43: (int) (fixedprice * (1 - (double) discountrate / 100)); 44: 45: // 46: taxincludedprice = (int) (discountprice * (1 + consumptiontax)); 47: 48: // 49: System.out.println(" "); 50: System.out.println(" :" + fixedprice + " "); 51: System.out.println(" "); 52: System.out.println( 53: " :" + discountprice + " " + discountrate + "%OFF "); 54: System.out.println(" "); 55: System.out.println(" " + taxincludedprice + " "); 56: System.out.println(" "); 57: g 58: 59: // 60: System.out.println(" "); 61: g 62: g Java Tips ² () ² break while break

52 48 2 (1) ,2,3 1,2, / !#"$&%('*) +-,!4"/$&%'*) 576 6!#"/$&%'8) 2.15: 13 13: ( ) 1: /** 2: * 3: * 4: * 5: * 6: * 7: * 8: macchan 9: $Id: JankenApplication.java,v /05/04 20:54:13 gackt Exp $ 10: */ 11: public class JankenApplication f 12: 13: public static void main(string[] args) f 14: JankenApplication jankenapplication = new JankenApplication(); 15: jankenapplication.main(); 16: g 17: 18: void main() f 19: 20: final int GOO = 1; // 21: final int CHOKI = 2; // 22: final int PAA = 3; //

53 : 24: String playernamea; // A 25: String playernameb; // B 26: int playerhanda; // A 27: int playerhandb; // B 28: int i; // 29: 30: // 31: System.out.println(" "); 32: System.out.println(" A "); 33: 34: // A 35: System.out.println(" A "); 36: System.out.print(">>"); 37: System.out.flush(); 38: playernamea = Input.getString(); 39: 40: // B 41: System.out.println(" B "); 42: System.out.print(">>"); 43: System.out.flush(); 44: playernameb = Input.getString(); 45: 46: // 47: while (true) f 48: 49: // A 50: System.out.println(playerNameA + " "); 51: System.out.println("1., 2., 3. (0. )"); 52: System.out.print(">>"); 53: System.out.flush(); 54: playerhanda = Input.getInt(); 55: 56: // 57: if (playerhanda == 0) f // 58: break; // 59: g 60: 61: // 62: i = 0; 63: while (i < 100) f 64: System.out.println(); 65: i = i + 1; 66: g 67: 68: // B 69: System.out.println(playerNameB + " "); 70: System.out.println("1., 2., 3. "); 71: System.out.print(">>"); 72: System.out.flush(); 73: playerhandb = Input.getInt(); 74: 75: // 76: if (playerhanda == GOO && playerhandb == CHOKI) f // VS

54 50 2 (1) 77: System.out.println(playerNameA + " "); 78: g else if (playerhanda == GOO && playerhandb == PAA) f // VS 79: System.out.println(playerNameB + " "); 80: g else if (playerhanda == CHOKI && playerhandb == GOO) f // VS 81: System.out.println(playerNameB + " "); 82: g else if (playerhanda == CHOKI && playerhandb == PAA) f // VS 83: System.out.println(playerNameA + " "); 84: g else if (playerhanda == PAA && playerhandb == GOO) f // VS 85: System.out.println(playerNameA + " "); 86: g else if (playerhanda == PAA && playerhandb == CHOKI) f // VS 87: System.out.println(playerNameB + " "); 88: g else if (playerhanda == playerhandb) f // 89: System.out.println(" "); 90: g else f // 91: System.out.println(" "); 92: g 93: g 94: 95: // 96: System.out.println(" "); 97: g 98: g 3 final [ ] [ ] = [ ]; 3

55 : 2 /** * * Manabu Sugiura $Id: AddTwoNumbersSample.java,v /05/04 17:16:47 macchan Exp $ */ public class AddTwoNumbersSample f public static void main(string args[]) f AddTwoNumbersSample addtwonumberssample = new AddTwoNumbersSample(); addtwonumberssample.main(); g void main() f g g int numbera; // int numberb; // // numbera = 3; numberb = 5; // System.out.println( numbera + " " + numberb + " " + numbera + numberb + " ");

56 52 2 (1) 3* 1. g ² g

K227 Java 2

K227 Java 2 1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html

More information

8 if switch for while do while 2

8 if switch for while do while 2 (Basic Theory of Information Processing) ( ) if for while break continue 1 8 if switch for while do while 2 8.1 if (p.52) 8.1.1 if 1 if ( ) 2; 3 1 true 2 3 false 2 3 3 8.1.2 if-else (p.54) if ( ) 1; else

More information

10/8 Finder,, 1 1. Finder MAC OS X 2. ( ) MAC OS X Java ( ) 3. MAC OS X Java ( ) / 10

10/8 Finder,, 1 1. Finder MAC OS X 2. ( ) MAC OS X Java ( ) 3. MAC OS X Java ( ) / 10 10/8 2015-10-08 URL : http://webct.kyushu-u.ac.jp, 10/8 1 / 10 10/8 Finder,, 1 1. Finder MAC OS X 2. ( ) MAC OS X Java ( ) 3. MAC OS X Java ( ) 1. 30 2 / 10 10/8 Finder 1 Figure : : Apple.com 2, 3 / 10

More information

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225 Java Java Java Java Java 4 p35 4-2 * *** ***** *** * Unix p36 4-3 a,b,c,d 100,200,250,500 a*b = 20000 a*b+c = 20250 a*b+c*d = 145000 (a+b)*(c+d) = 225000 a+b*c+d = 50600 b/a+d/c = 4 p38 4-4 (1) mul = 1

More information

)+, $( -++ $ )* "& $ "$...( # / $ & ' / $# && &# & ' '' '( '# ' "& / $ $

)+, $( -++ $ )* & $ $...( # / $ & ' / $# && &# & ' '' '( '# ' & / $ $ !"#!$#!"# $! %&#'& %&#( %&#'& )* )* '& ( )+, $( -++ $ )* "& $ "$...( # / $ & ' / $# && &# & ' '' '( '# ' "& / $ $ " $& 0 $ '*# & 1 2 1# 2 1 "2 $ 3&$ 4$2 3&& 1 2 1# 2 1 "2 1& 2 ' ( 訳 者 注 # 番 号 が 大 きくなるほど

More information

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World");

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println(Hello World); (Basic Theory of Information Processing) Java (eclipse ) Hello World! eclipse Java 1 3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello

More information

Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の break; まで処理しますどれにも一致致しない場合 def

Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の break; まで処理しますどれにも一致致しない場合 def Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の まで処理しますどれにも一致致しない場合 default: から直後の まで処理します 式の結果 ラベル 定数 整数または文字 (byte, short, int,

More information

r1.dvi

r1.dvi 2006 1 2006.10.6 ( 2 ( ) 1 2 1.5 3 ( ) Ruby Java Java Java ( Web Web http://lecture.ecc.u-tokyo.ac.jp/~kuno/is06/ / ( / @@@ ( 3 ) @@@ : ( ) @@@ (Q&A) ( ) 1 http://www.sodan.ecc.u-tokyo.ac.jp/cgi-bin/qbbs/view.cgi

More information

Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 条件判断文 3 switch 文 switch 文式が case の値と一致した場合 そこから直後の break; までを処理し どれにも一致しない場合 default; から直後の break; までを処理する 但し 式や値 1

Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 条件判断文 3 switch 文 switch 文式が case の値と一致した場合 そこから直後の break; までを処理し どれにも一致しない場合 default; から直後の break; までを処理する 但し 式や値 1 Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 条件判断文 3 switch 文 switch 文式が case の値と一致した場合 そこから直後の までを処理し どれにも一致しない場合 default; から直後の までを処理する 但し 式や値 1 値 2は整数または文字である switch( 式 ) case 値 1: // コロン : です セミコロン ; と間違えないように!!

More information

明解Javaによるアルゴリズムとデータ構造

明解Javaによるアルゴリズムとデータ構造 21 algorithm List 1-1 a, b, c max Scanner Column 1-1 List 1-1 // import java.util.scanner; class Max3 { public static void main(string[] args) { Scanner stdin = new Scanner(System.in); Chap01/Max3.java

More information

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flow

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) flow Java (5) 1 Lesson 3: 2008-05-20 2 x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java 1.1 10 10 0 1.0 2.0, 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flowrate.dat" 10 8 6 4 2 0 0 5 10 15 20 25 time (s) 1 1

More information

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb " # $ % & ' ( ) * +, -. / 0 1 2 3 4 5 6 7 8 9 : ; < = >? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y " # $ % & ' ( ) * + , -. / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B

More information

r02.dvi

r02.dvi 172 2017.7.16 1 1.1? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X ( ) 1.2 1 2-0 ( ) ( ) ( ) (12) ( ) (112) (131) 281 26 1 (syntax) (semantics) ( ) 2 2.1 BNF BNF(Backus Normal Form) Joun Backus (grammer) English

More information

ohp02.dvi

ohp02.dvi 172 2017.7.16 1 ? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X 2 ( ) 3 2-0 ( ) ( ) ( ) (12) ( ) (112) 31) 281 26 1 4 (syntax) (semantics) ( ) 5 BNF BNF(Backus Normal Form) Joun Backus (grammer) English grammer

More information

: : : TSTank 2

: : : TSTank 2 Java (8) 2008-05-20 Lesson6 Lesson5 Java 1 Lesson 6: TSTank1, TSTank2, TSTank3 java 2 car1 car2 Car car1 = new Car(); Car car2 = new Car(); car1.setcolor(red); car2.setcolor(blue); car2.changeengine(jet);

More information

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) 3 5 14 18 21 23 23 24 28 29 29 31 32 34 35 35 36 38 40 44 44 45 46 49 49 50 pref : 2004/6/5 (11:8) 50 51 52 54 55 56 57 58 59 60 61

More information

新・明解Java入門

新・明解Java入門 537,... 224,... 224,... 32, 35,... 188, 216, 312 -... 38 -... 38 --... 102 --... 103 -=... 111 -classpath... 379 '... 106, 474!... 57, 97!=... 56 "... 14, 476 %... 38 %=... 111 &... 240, 247 &&... 66,

More information

Java updated

Java updated Java 2003.07.14 updated 3 1 Java 5 1.1 Java................................. 5 1.2 Java..................................... 5 1.3 Java................................ 6 1.3.1 Java.......................

More information

Microsoft Word - keisankigairon.ch doc

Microsoft Word - keisankigairon.ch doc 1000000100001010 1000001000001011 0100001100010010 1010001100001100 load %r1,10 load %r2,11 add %r3,%r1,%r2 store %r3,12 k = i + j ; = > (* 1 2 3 4 5 6 7 8 9 10) 3628800 DO 3 I=1,3 DO3I=1.3 DO3I 1.3

More information

新・明解Javaで学ぶアルゴリズムとデータ構造

新・明解Javaで学ぶアルゴリズムとデータ構造 第 1 章 基本的 1 n 21 1-1 三値 最大値 algorithm List 1-1 a, b, c max // import java.util.scanner; class Max3 { public static void main(string[] args) { Scanner stdin = new Scanner(System.in); List 1-1 System.out.println("");

More information

Java プログラミング Ⅰ 3 回目変数 変数 変 数 一時的に値を記憶させておく機能型 ( データ型 ) と識別子をもつ 2 型 ( データ型 ) 変数の種類型に応じて記憶できる値の種類や範囲が決まる 型 値の種類 値の範囲 boolean 真偽値 true / false char 2バイト文

Java プログラミング Ⅰ 3 回目変数 変数 変 数 一時的に値を記憶させておく機能型 ( データ型 ) と識別子をもつ 2 型 ( データ型 ) 変数の種類型に応じて記憶できる値の種類や範囲が決まる 型 値の種類 値の範囲 boolean 真偽値 true / false char 2バイト文 Java プログラミング Ⅰ 3 回目変数 変数 変 数 一時的に値を記憶させておく機能型 ( データ型 ) と識別子をもつ 2 型 ( データ型 ) 変数の種類型に応じて記憶できる値の種類や範囲が決まる 型 値の種類 値の範囲 boolean 真偽値 true / false char 2バイト文字 0x0000 ~ 0xffff byte 1バイト整数 - 2 8 ~ 2 8-1 short 2バイト整数

More information

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac Actual4Test http://www.actual4test.com Actual4test - actual test exam dumps-pass for IT exams Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN

More information

a new way of learning Japanese p2 p5 p8 p11 p13 CONTENTS p01-16_ことは の学ひ _別冊_No.10.indd 10 /?< #)' -= #)' #)' &)(.8 0 ",+B C ; ",+B C?1 7B C 3 7 $!%* $!%* $ " 254 > @6 A 9 : 254 ",+B C ",+B C $!%*

More information

break 文 switch ブロック内の実行中の処理を強制的に終了し ブロックから抜けます switch(i) 強制終了 ソースコード例ソースファイル名 :Sample7_1.java // 入力値の判定 import java.io.*; class Sample7_1 public stati

break 文 switch ブロック内の実行中の処理を強制的に終了し ブロックから抜けます switch(i) 強制終了 ソースコード例ソースファイル名 :Sample7_1.java // 入力値の判定 import java.io.*; class Sample7_1 public stati Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の まで処理しますどれにも一致しない場合 default: から直後の まで処理します 式は byte, short, int, char 型 ( 文字または整数 ) を演算結果としますラベルには整数リテラル

More information

Java (7) Lesson = (1) 1 m 3 /s m 2 5 m 2 4 m 2 1 m 3 m 1 m 0.5 m 3 /ms 0.3 m 3 /ms 0.6 m 3 /ms 1 1 3

Java (7) Lesson = (1) 1 m 3 /s m 2 5 m 2 4 m 2 1 m 3 m 1 m 0.5 m 3 /ms 0.3 m 3 /ms 0.6 m 3 /ms 1 1 3 Java (7) 2008-05-20 1 Lesson 5 1.1 5 3 = (1) 1 m 3 /s 1 2 3 10 m 2 5 m 2 4 m 2 1 m 3 m 1 m 0.5 m 3 /ms 0.3 m 3 /ms 0.6 m 3 /ms 1 1 3 1.2 java 2 1. 2. 3. 4. 3 2 1.3 i =1, 2, 3 V i (t) 1 t h i (t) i F, k

More information

Java演習(4) -- 変数と型 --

Java演習(4)   -- 変数と型 -- 50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends

More information

untitled

untitled 2011 7 21 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2011/index.html tech.ac.jp/k1sakai/lecture/alg/2011/index.html html 1 5 2 3 4 - 5 .. 6 - 7 public class KnapsackBB

More information

解きながら学ぶJava入門編

解きながら学ぶJava入門編 44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean

More information

ALG ppt

ALG ppt 2012 6 21 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 1 l l O(1) l l l 2 (123 ) l l l l () l H(k) = k mod n (k:, n: ) l l 3 4 public class MyHashtable

More information

(Eclipse\202\305\212w\202\324Java2\215\374.pdf)

(Eclipse\202\305\212w\202\324Java2\215\374.pdf) C H A P T E R 11 11-1 1 Sample9_4 package sample.sample11; public class Sample9_4 { 2 public static void main(string[] args) { int[] points = new int[30]; initializearray(points); double averagepoint =

More information

アルゴリズムとデータ構造1

アルゴリズムとデータ構造1 1 200972 (sakai.keiichi@kochi sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi ://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2009/index.html 29 20 32 14 24 30 48 7 19 21 31 Object public class

More information

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1 Java (9) 1 Lesson 7 2008-05-20 Java System.out.println() 1 Java API 1 Java Java 1 GUI 2 Java 3 1.1 5 3 1.0 10.0, 1.0, 0.5 5.0, 3.0, 0.3 4.0, 1.0, 0.6 1 2 4 3, ( 2 3 2 1.2 Java (stream) 4 1 a 5 (End of

More information

Java学習教材

Java学習教材 Java 2016/4/17 Java 1 Java1 : 280 : (2010/1/29) ISBN-10: 4798120987 ISBN-13: 978-4798120980 2010/1/29 1 Java 1 Java Java Java class FirstExample { public static void main(string[] args) { System.out.println("

More information

I java A

I java A I java 065762A 19.6.22 19.6.22 19.6.22 1 1 Level 1 3 1.1 Kouza....................................... 3 1.2 Kouza....................................... 4 1.3..........................................

More information

untitled

untitled 2011 6 20 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2011/index.html tech.ac.jp/k1sakai/lecture/alg/2011/index.html html 1 O(1) O(1) 2 (123) () H(k) = k mod n

More information

JavaプログラミングⅠ

JavaプログラミングⅠ Java プログラミング Ⅰ 6 回目 if 文と if else 文 今日の講義で学ぶ内容 関係演算子 if 文と if~else 文 if 文の入れ子 関係演算子 関係演算子 ==,!=, >, >=,

More information

ALG2012-F.ppt

ALG2012-F.ppt 2012 7 26 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 5 2 3 4 - 5 .. 6 - 7 public class KnapsackBB { // 0-1 private static double maxsofar; private

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information

Java プログラミング Ⅰ 3 回目変 数 今日の講義講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能 変数は 型 ( データ型 ) と識別子をもちます 2 型 ( データ型 ) 変数に記憶する値の種類変数の型は 記憶できる値の種類と範囲

Java プログラミング Ⅰ 3 回目変 数 今日の講義講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能 変数は 型 ( データ型 ) と識別子をもちます 2 型 ( データ型 ) 変数に記憶する値の種類変数の型は 記憶できる値の種類と範囲 Java プログラミング Ⅰ 3 回目変 数 今日の講義講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能 変数は 型 ( データ型 ) と識別子をもちます 2 型 ( データ型 ) 変数に記憶する値の種類変数の型は 記憶できる値の種類と範囲を決定します 次の型が利用でき これらの型は特に基本型とよばれます 基本型 値の種類 値の範囲 boolean

More information

2

2 問題 次の設問に答えよ 設問. Java のソースコードをコンパイルするコマンドはどれか a) java b) javac c) javadoc d) javaw 設問. Java のバイトコード ( コンパイル結果 ) を実行するコマンドはどれか a) java b) javac c) javadoc d).jar 設問. Java のソースコードの拡張子はどれか a).c b).java c).class

More information

JavaプログラミングⅠ

JavaプログラミングⅠ Java プログラミング Ⅰ 12 回目クラス 今日の講義で学ぶ内容 クラスとは クラスの宣言と利用 クラスの応用 クラス クラスとは 異なる複数の型の変数を内部にもつ型です 直観的に表現すると int 型や double 型は 1 1 つの値を管理できます int 型の変数 配列型は 2 5 8 6 3 7 同じ型の複数の変数を管理できます 配列型の変数 ( 配列変数 ) クラスは double

More information

! "! # # # #!#!# # # # # # !"!! " " ##### ##!### # $%&'( )*+! " # ! " # $$$$ $ % % % & ' ' ' ( ) )* ) )* +,,* - +,,*. / 0 0* 1 2 1 1 3 1 2 1 1 * 42 5 4 4 6 5 4 1)2 1)5 1) /+2 /+ /+* : ; < = = *!! > >

More information

oop1

oop1 public class Car{ int num; double gas; // double distance; String maker; // // // void drive(){ System.out.println(""); Car.java void curve(){ System.out.println(""); void stop(){ System.out.println("");

More information

文字列操作と正規表現

文字列操作と正規表現 文字列操作と正規表現 オブジェクト指向プログラミング特論 2018 年度只木進一 : 工学系研究科 2 文字列と文字列クラス 0 個以上の長さの文字の列 Java では String クラス 操作 文字列を作る 連結する 文字列中に文字列を探す 文字列中の文字列を置き換える 部分文字列を得る 3 String クラス 文字列を保持するクラス 文字列は定数であることに注意 比較に注意 == : オブジェクトとしての同等性

More information

新・明解Javaで学ぶアルゴリズムとデータ構造

新・明解Javaで学ぶアルゴリズムとデータ構造 第 3 章 探索 Arrays.binarySearch 743 3-1 探索 探索 searching key 配列 探索 Fig.3-1 b c 75 a 6 4 3 2 1 9 8 2 b 64 23 53 65 75 21 3-1 53 c 5 2 1 4 3 7 4 Fig.3-1 a 763 3-2 線形探索 線形探索 linear search sequential search 2

More information

Java講座

Java講座 ~ 第 1 回 ~ 情報科学部コンピュータ科学科 2 年竹中優 プログラムを書く上で Hello world 基礎事項 演算子 構文 2 コメントアウト (//, /* */, /** */) をしよう! インデントをしよう! 変数などにはわかりやすい名前をつけよう! 要するに 他人が見て理解しやすいコードを書こうということです 3 1. Eclipse を起動 2. ファイル 新規 javaプロジェクト

More information

#"

# !" #" !!! $" x %" 2011.3.11 3.12 3.1 4.02 4.17 4.24 4.28 4.29 5.8 5.14 6.4 7.3 8.1 8.10 8.23 8.28 9.10 9.30 11.13 11.21 12.23 12.28 2012.2.24 3.18 3.20 3.24 &" ! '" (" )" *" !+" !!" !#" !$" !%" !& !'"

More information

問題1 以下に示すプログラムは、次の処理をするプログラムである

問題1 以下に示すプログラムは、次の処理をするプログラムである 問題 1 次のプログラムの出力結果を a~d の中から選べ public class Problem1 { int i=2; int j=3; System.out.println("i"+j); a) 23,b) 5,c) i3,d) ij 問題 2 次のプログラムの出力結果を a~d の中から選べ public class Problem2 { int a=6; if((a>=2)&&(a

More information

1/8 ページ Java 基礎文法最速マスター Java Javaの文法一覧です 他の言語をある程度知っている人はこれを読めばJavaの基礎をマスターしてJavaを書くことができるようになっています 簡易リファレンスとしても利用できると思いますので これは足りないと思うものがあれば教えてください 1. 基礎 class の作成プログラムはclassに記述します たとえばSampleという名前のclassを作る場合

More information

Quick Sort 計算機アルゴリズム特論 :2017 年度 只木進一

Quick Sort 計算機アルゴリズム特論 :2017 年度 只木進一 Quick Sort 計算機アルゴリズム特論 :2017 年度 只木進一 2 基本的考え方 リスト ( あるいは配列 )SS の中の ある要素 xx(pivot) を選択 xx より小さい要素からなる部分リスト SS 1 xx より大きい要素からなる部分リスト SS 2 xx は SS 1 または SS 2 に含まれる 長さが 1 になるまで繰り返す pivot xx の選び方として 中央の要素を選択すると効率が良い

More information

明解Javaによるアルゴリズムとデータ構造

明解Javaによるアルゴリズムとデータ構造 74 searching 3 key Fig.3-1 75 2を探索 53を探索 3-1 5 2 1 4 3 7 4 を探索 Fig.3-1 76 3 linear searchsequential search 2 Fig.3-2 0 ❶ ❷ ❸ 配列の要素を先頭から順に走査していく 探索すべき値と等しい要素を発見 Fig.3-2 6 4 3 2 3-2Fig.3-3 77 5 Fig.3-3 0

More information

Java演習(2) -- 簡単なプログラム --

Java演習(2)   -- 簡単なプログラム -- Java public class Hello Hello (class) (field)... (method)... Java main Hello World(Hello.java) public class Hello { public static void main(string[ ] args) { public() (package) Hello World(Hello.java)

More information

コーディング基準.PDF

コーディング基準.PDF Java Java Java Java.java.class 1 private public package import / //////////////////////////////////////////////////////////////////////////////// // // // // ////////////////////////////////////////////////////////////////////////////////

More information

JavaプログラミングⅠ

JavaプログラミングⅠ Java プログラミング Ⅰ 3 回目変数 今日の講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能です 変数は 型 ( データ型ともいいます ) と識別子をもちます 2 型 変数に記憶できる値の種類です型は 値の種類に応じて次の 8 種類があり これを基本型といいます 基本型値の種類値の範囲または例 boolean 真偽値 true または

More information

2

2 問題 1 次の設問 1~5 に答えよ 設問 1. Java のソースプログラムをコンパイルするコマンドはどれか a) java b) javac c) javadoc d) jdb 設問 2. Java のバイトコード ( コンパイル結果 ) を実行するコマンドはどれか a) java b) javac c) javadoc d) jdb 設問 3. Java のソースプログラムの拡張子はどれか a).c

More information

Java 3 p.2 3 Java : boolean Graphics draw3drect fill3drect C int C OK while (1) int boolean switch case C Calendar java.util.calendar A

Java 3 p.2 3 Java : boolean Graphics draw3drect fill3drect C int C OK while (1) int boolean switch case C Calendar java.util.calendar A Java 3 p.1 3 Java Java if for while C 3.1 if Java if C if if ( ) 1 if ( ) 1 else 2 1 1 2 2 1, 2 { Q 3.1.1 1. int n = 2; if (n

More information

アルゴリズムとデータ構造1

アルゴリズムとデータ構造1 1 2005 7 22 22 (sakai.keiichi@kochi sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2005/index.html tech.ac.jp/k1sakai/lecture/alg/2005/index.html f(0) = 1, f(x) =

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information

Microsoft PowerPoint ppt

Microsoft PowerPoint ppt 独習 Java ( 第 3 版 ) 6.7 変数の修飾子 6.8 コンストラクタの修飾子 6.9 メソッドの修飾子 6.10 Object クラスと Class クラス 6.7 変数の修飾子 (1/3) 変数宣言の直前に指定できる修飾子 全部で 7 種類ある キーワード final private protected public static transient volatile 意味定数として使える変数同じクラスのコードからしかアクセスできない変数サブクラスまたは同じパッケージ内のコードからしかアクセスできない変数他のクラスからアクセスできる変数インスタンス変数ではない変数クラスの永続的な状態の一部ではない変数不意に値が変更されることがある変数

More information

橡統計担当者のためのエクセル表紙.PDF

橡統計担当者のためのエクセル表紙.PDF Num Lock(Pad Lock) ( Num Lock) [ ][ ] [ ][ ] Alt Alt 4 + ( ) 3+3 - ( ) 3-1 -1 * ( ) 3*3 / ( ) 3/3 % ( ) 20% ^ ( ) 3^2 (3*3 ) 2 TRUE FALSE = ( ) A1=B1 > ( ) A1>B1 < ( ) A1= ( ) A1>=B1

More information

2.2 Java C main Java main 2 C 6 C Java 3 C Java ( ) G101Hello.java G101Hello main G101Hello.java /* G101Hello */ class G101Hello { /* main */ public s

2.2 Java C main Java main 2 C 6 C Java 3 C Java ( ) G101Hello.java G101Hello main G101Hello.java /* G101Hello */ class G101Hello { /* main */ public s 2 2013 4 16 2.1............................... 2 1 2.2 Java......................... 2 2 2.3............. 2 2 2.4................................ 2 4 2.5............................ 2 5 2.6............................

More information

問 次の Fortran プログラムの説明及びプログラムを読んで、設問に答えよ。

問 次の Fortran プログラムの説明及びプログラムを読んで、設問に答えよ。 解答例 問題 1 変数 a が 3 以上でかつ 7 以下の場合 true と表示し そうでない場合は false と表示するプログラムである public class Prog061004_01 { int a; boolean b; a = Integer.parseInt(buf.readLine()); b = (a >= 3) && (a

More information

プログラミング入門1

プログラミング入門1 プログラミング入門 1 第 4 回 繰り返し (for ループ ) 授業開始前に ログオンして待機して ください Java 1 第 4 回 2 不要ファイルの掃除 前回デスクトップにファイルをダウンロードした場合 次のものを削除してください week03.zip デスクトップにファイルを置きすぎると コンピュータをシャットダウンできなくなります Java 1 第 4 回 3 授業を始めます 前回の課題は

More information

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV tutimura@mist.i.u-tokyo.ac.jp kaneko@ipl.t.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 12 11 p.1/33 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション "# "# $%&' "#$% $# & $# $% % ' ()(*"#$% +,(- ()(*"#$%.' ()(* $/.0##'' %0$&0% 1*2#/0/%'&0343$56 789#/0/'%&04../ "3"0##"$ "0%0$" "7 1*2#.30///04%.$ 789#.30///0#$'4 http://www.ibie2016.com/exhibitorlist/

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

(Basic Theory of Information Processing) 1

(Basic Theory of Information Processing) 1 (Basic Theory of Information Processing) 1 10 (p.178) Java a[0] = 1; 1 a[4] = 7; i = 2; j = 8; a[i] = j; b[0][0] = 1; 2 b[2][3] = 10; b[i][j] = a[2] * 3; x = a[2]; a[2] = b[i][3] * x; 2 public class Array0

More information

目 次 Java GUI 3 1 概要 クラス構成 ソースコード例 課題...7 i

目 次 Java GUI 3 1 概要 クラス構成 ソースコード例 課題...7 i Java GUI 3 Java GUI 3 - サンプルプログラム (1) - 2011-09-25 Version 1.00 K. Yanai 目 次 Java GUI 3 1 概要...1 2 クラス構成...2 3 ソースコード例...3 4 課題...7 i 1 概要まずは簡単なサンプルプログラムをみながら Java GUI の基本的なことを学びましょう 本サンプルは 図に示すようなひとつのメイン画面を使用します

More information

ALG2012-A.ppt

ALG2012-A.ppt 21279 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/212/index.html (, )ε m = n C2 = n ( n 1) / 2 m = n ( n 1) 1 11 11 111 11 111 111 1111 1 1 11 1 11 11 111 4-dimentional

More information

226

226 226 227 Main ClientThread Request Channel WorkerThread Channel startworkers takerequest requestqueue threadpool WorkerThread channel run Request tostring execute name number ClientThread channel random

More information

1.ppt

1.ppt /* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)

More information

プログラミング基礎I(再)

プログラミング基礎I(再) 山元進 クラスとは クラスの宣言 オブジェクトの作成 クラスのメンバー フィールド 変数 配列 メソッド メソッドとは メソッドの引数 戻り値 変数の型を拡張したもの 例えば車のデータベース 車のメーカー 車種 登録番号などのデータ データベースの操作 ( 新規データのボタンなど ) プログラムで使う部品の仕様書 そのクラスのオブジェクトを作ると初めて部品になる 継承 などの仕組みにより カスタマイズが安全

More information

ohp07.dvi

ohp07.dvi 17 7 (2) 2017.9.13 1 BNF BNF ( ) ( ) 0 ( ) + 1 ( ) ( ) [ ] BNF BNF BNF prog ::= ( stat ) stat ::= ident = expr ; read ident ; print expr ; if ( expr ) stat while ( expr ) stat { prog expr ::= term ( +

More information

JAVA とテンプレート

JAVA とテンプレート JAVA とテンプレート 序論 : コンテナ 他のクラスのオブジェクトを保存するものをコンテナ (Container) と呼ぶ 集合 リスト 表 コンテナに求められる機能 追加 削除 参照 要素の比較 並べ替え 要素のクラスが不明では 比較できない 要素が想定しているクラスのものかの判定 テンプレート以前の対応方法 コンテナ設計時に 保存されるクラスを特定してコンテナをコードする 保存されるクラスごとに作成しなければならない

More information

グラフと組み合わせ 課題 7 ( 解答例 ) 2013/5/27 1 列挙 n 個の文字の集合 { } S = a, a,, an の全てからなる文字列 つまり同じ文字を含まない 長さ n の文字列を列挙する 方法を考える 1. 何通りの文字列があるかを答えなさい また そのことが正しい

グラフと組み合わせ 課題 7 ( 解答例 ) 2013/5/27 1 列挙 n 個の文字の集合 { } S = a, a,, an の全てからなる文字列 つまり同じ文字を含まない 長さ n の文字列を列挙する 方法を考える 1. 何通りの文字列があるかを答えなさい また そのことが正しい グラフと組み合わせ 課題 7 ( 解答例 ) 2013/5/27 1 列挙 n 個の文字の集合 { S = a, a,, an 0 1 1 の全てからなる文字列 つまり同じ文字を含まない 長さ n の文字列を列挙する 方法を考える 1. 何通りの文字列があるかを答えなさい また そのことが正しいことを数学的帰納法で示しなさい 2. 文字列を列挙する再帰的アルゴリズムを構築しなさい 3. n = 4

More information

2 static final int DO NOTHING ON CLOSE static final int HIDE ON CLOSE static final int DISPOSE ON CLOSE static final int EXIT ON CLOSE void setvisible

2 static final int DO NOTHING ON CLOSE static final int HIDE ON CLOSE static final int DISPOSE ON CLOSE static final int EXIT ON CLOSE void setvisible 12 2013 7 2 12.1 GUI........................... 12 1 12.2............................... 12 4 12.3..................................... 12 7 12.4....................................... 12 9 12.5 : FreeCellPanel.java............................

More information

$ java StoreString abc abc ed abced twice abcedabced clear xyz xyz xyz bingo! abc bingo!abc ^Z mport java.io.*; ublic class StoreString { public static void main(string[] args) throws IOException{ BufferedReader

More information

ただし 無作為にスレッドを複数実行すると 結果不正やデッドロックが起きる可能性がある 複数のスレッド ( マルチスレッド ) を安全に実行する ( スレッドセーフにする ) ためには 同期処理を用いるこ とが必要になる 同期処理は 予約語 synchronized で行うことができる ここでは sy

ただし 無作為にスレッドを複数実行すると 結果不正やデッドロックが起きる可能性がある 複数のスレッド ( マルチスレッド ) を安全に実行する ( スレッドセーフにする ) ためには 同期処理を用いるこ とが必要になる 同期処理は 予約語 synchronized で行うことができる ここでは sy オブジェクト指向プログラミング演習 2010/10/27 演習課題 スレッド ( その 2) 同期処理 結果不正 デッドロック 前回のスレッドの演習では 複数のスレッドを実行し 一つのプログラムの中の違う処理を同時に実行し た ただし 無作為にスレッドを複数実行すると 結果不正やデッドロックが起きる可能性がある 複数のスレッド ( マルチスレッド ) を安全に実行する ( スレッドセーフにする )

More information

Microsoft Word - =?iso-2022-jp?B?SFAbJEJNUSEhIUpMPkEwRn4kaiFLGyhCNDAbJEJCZUZ8S1wbKEI=?= =?iso-2022-jp?B?GyRCP00kTkNmOXE0USFKI1cjUCFLRHM9UE1RGyhCKBskQj0kGyhCLg==?= =?iso-2022-jp?B?ZG9j?=

Microsoft Word - =?iso-2022-jp?B?SFAbJEJNUSEhIUpMPkEwRn4kaiFLGyhCNDAbJEJCZUZ8S1wbKEI=?=	=?iso-2022-jp?B?GyRCP00kTkNmOXE0USFKI1cjUCFLRHM9UE1RGyhCKBskQj0kGyhCLg==?=	=?iso-2022-jp?B?ZG9j?= 40 COE-CAS RA 2005 10 21 COE 40 2005 80 1990 1 1990 1995 50 21 3 1 (2005 ) 1 2 1998 11 80 ODA 3 2001 (2002 ) (2003 9 ) (2003 10 ) (2004 8 ) Voice SAPIO 4 5 (1932 ) (1932 ) (1933 ) (1948 ) (1930 ) ( 1971

More information

6 p.1 6 Java GUI GUI paintcomponent GUI mouseclicked, keypressed, actionperformed mouseclicked paintcomponent thread, 1 GUI 6.0.2, mutlithread C

6 p.1 6 Java GUI GUI paintcomponent GUI mouseclicked, keypressed, actionperformed mouseclicked paintcomponent thread, 1 GUI 6.0.2, mutlithread C 6 p.1 6 Java GUI GUI paintcomponent GUI mouseclicked, keypressed, actionperformed mouseclicked paintcomponent 6.0.1 thread, 1 GUI 6.0.2, mutlithread CPU 1 CPU CPU +----+ +----+ +----+ Java 1 CPU 6 p.2

More information

プログラミングA

プログラミングA プログラミング A 第 10 回 演習 2015 年 6 月 29 日 東邦大学金岡晃 本日の内容 中間テストの解説 演習 1 2015/6/29 プログラミング A 中間テスト解説 : 問 1 < 問 1> 下記の命令が実行された後の a の値を書きなさい ( 省略 ). int a=13; 答え : 13 2 中間テスト解説 : 問 2 < 問 2> 下記の命令が実行された後の a の値を書きなさい

More information

Prog2_9th

Prog2_9th 2013 年 11 月 21 日 ( 木 ) 実施例外処理 Java 言語では, 作成したプログラムを実行する際に, 記述した処理が想定しない事態によって実行できなくなる場合を例外と呼び, その例外への対処, 即ち例外処理が求められる これまでの教材に登場した例外の中で,IOException はコンパイラがチェックするため, 例外処理を必ず記述しなければコンパイルが出来ないものであるのに対して,ArithmeticException

More information

2 1 Web Java Android Java 1.2 6) Java Java 7) 6) Java Java (Swing, JavaFX) (JDBC) 7) OS 1.3 Java Java

2 1 Web Java Android Java 1.2 6) Java Java 7) 6) Java Java (Swing, JavaFX) (JDBC) 7) OS 1.3 Java Java 1 Java Java 1.1 Java 1) 2) 3) Java OS Java 1.3 4) Java Web Start Web / 5) Java C C++ Java JSP(Java Server Pages) 1) OS 2) 3) 4) Java Write Once, Run Anywhere 5) Java Web Java 2 1 Web Java Android Java

More information

問 次の Fortran プログラムの説明及びプログラムを読んで、設問に答えよ。

問 次の Fortran プログラムの説明及びプログラムを読んで、設問に答えよ。 ソフトウェア基礎演習課題 文法理解度確認範囲 問題 1 データ型 ( 変数, データ型 ) 問題 2 制御構造 (switch 文 ) 問題 3 制御構造 (while 文 ) 問題 4 制御構造と配列 ( 総和 ) 問題 5 制御構造と配列 ( 総和, 平均 ) 問題 6 データ型と各種演算子 ( 文字列, 検索 ) 問題 7 クラスの定義 ( メソッドの定義, コンストラクタの定義, キャスト

More information

tkk0408nari

tkk0408nari SQLStatement Class Sql Database SQL Structured Query Language( ) ISO JIS http://www.techscore.com/tech/sql/02_02.html Database sql Perl Java SQL ( ) create table tu_data ( id integer not null, -- id aid

More information

10K pdf

10K pdf #1 #2 Java class Circle { double x; // x double y; // y double radius; // void set(double tx, double ty){ x = tx; y = ty; void set(double tx, double ty, double r) { x = tx; y = ty; radius = r; // Circle

More information

JavaプログラミングⅠ

JavaプログラミングⅠ Java プログラミング Ⅰ 3 回目変数 今日の講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能です 変数は 型 ( データ型ともいいます ) と識別子をもちます 2 型 変数に記憶できる値の種類です型は 値の種類に応じて次の 8 種類があり これを基本型といいます 基本型値の種類値の範囲または例 boolean 真偽値 true または

More information

Thread

Thread 14 2013 7 16 14.1....................................... 14 1 14.2 Thread................................... 14 1 14.3............................. 14 5 14.4....................................... 14 10

More information

Assignment_.java 課題 : 転置行列 / class Assignment_ public static void main(string[] args) int i,j; int[][] array = 1,,,,,,,,,,,,,1,1,; 行 列行列 i

Assignment_.java 課題 : 転置行列 / class Assignment_ public static void main(string[] args) int i,j; int[][] array = 1,,,,,,,,,,,,,1,1,; 行 列行列 i 1 1 0 1 Assignment_1.java 課題 1: チェッカー / class Assignment_1 public static void main(string[] args) int i,j; チェッカー用の 次元配列 int[][] checker=new int[][]; チェッカーパターンを書き込む for(i=0;i

More information

TopLink å SampleClient.java... 5 Ò readallsample() querysample() cachesample() Ç..

TopLink å SampleClient.java... 5 Ò readallsample() querysample() cachesample() Ç.. lê~åäé= qçéiáåâ= NMÖENMKNKPF Volume2 Creation Date: Mar 04, 2005 Last Update: Aug 22, 2005 Version 1.0 ...3... 3 TopLink å...4 1... 4... 4 SampleClient.java... 5 Ò... 8... 9... 10 readallsample()... 11

More information

†ı25”Y„o-PDF.ren

†ı25”Y„o-PDF.ren 12,000 10,000 8,000 6,000 4,000 2,000 0 1998 1999 2000 2001 2002 2003 2004 1,200 1,000 800 600 400 200 0 1998 1999 2000 2001 2002 2003 2004 $ "! ''" '' ''$ ''% ''& '''! " ' & % $ "! ''" ' '$ '% '& ''!

More information

76

76 ! # % & % & %& %& " $ 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 % & &! & $ & " & $ & # & ' 91 92 $ % $'%! %(% " %(% # &)% & 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 !$!$ "% "%

More information