untitled

Size: px
Start display at page:

Download "untitled"

Transcription

1 JCSP CSP HPC H.Nakahara 1

2 2

3 CSP A B HPC H.Nakahara 3

4 CSP HPC H.Nakahara 4

5 CSP Process A chan Process B ( DFD) HPC H.Nakahara 5

6 DFD HPC H.Nakahara 6

7 DFD FAX OK? HPC H.Nakahara 7

8 HPC H.Nakahara 8

9 HPC H.Nakahara 9

10 HPC H.Nakahara 10

11 Process A chan Process B Ready Ready or HPC H.Nakahara 11

12 Process A chan Process B Ready Ready or HPC H.Nakahara 12

13 Process A chan Process B HPC H.Nakahara 13

14 Process A chan Process B CSP HPC H.Nakahara 14

15 Controller 2 1 : : 0.5 HPC H.Nakahara 15

16 CSP : Communicating Sequential Processes HPC H.Nakahara 16

17 CSP OCCAM OCCAM Transputer OCCAM/Transputer HPC H.Nakahara 17

18 CSP for JAVA Process A chan Process B JAVA CSP for JAVA JCSP HPC H.Nakahara 18

19 ch0 ch1 ch2 0 1 ON/OFF 2 ch6 3 4 HPC H.Nakahara 19

20 CSP ON/OFF HPC H.Nakahara 20

21 CSP ON/OFF HPC H.Nakahara 21

22 CSP Send ch Read HPC H.Nakahara 22

23 JCSP Send ch Read HPC H.Nakahara 23

24 JCSP Send ch Read HPC H.Nakahara 24

25 JCSP Send ch Read Send Read HPC H.Nakahara 25

26 JCSP Send ch Read Send Read HPC H.Nakahara 26

27 Send ch Read HPC H.Nakahara 27

28 run( ){ } Send ch run( ){ } Read run( ) run( ) HPC H.Nakahara 28

29 Send import org.jcsp.lang.*; //ver1.1 class Send implements CSProcess{ private ChannelOutput out; public Send(ChannelOutput out){ this.out=out; } public void run( ) { int i=0; while (true){ i=i+1; out.write (new Integer ( i ) ) ; } } } HPC H.Nakahara 29

30 Read import org.jcsp.lang.*; //ver1.1 class Read implements CSProcess{ private ChannelInput in; public Read(ChannelInput in){ this.in=in; } public void run( ) { Integer i; while (true){ i=(integer)in.read(); System.out.println( "data="+i.intvalue( ) ) ; } } } HPC H.Nakahara 30

31 import org.jcsp.lang.*; //ver1.1 public class ParaMain{ public static void main( String[] arg){ One2OneChannel chan=channel.one2one ( ) ; // ver1.1 Send send=new Send( chan.out( ) ); Read read=new Read( chan.in( ) ); CSProcess[] csp=new CSProcess[]{send,read}; Parallel Para=new Parallel(csp); Para.run(); // } } HPC H.Nakahara 31

32 SendPassRead Send ch1 Pass ch2 Read 10 HPC H.Nakahara 32

33 Pass class Pass implements CSProcess{ private ChannelInput in; private ChannelOutput out; public Pass(ChannelInput inch,channeloutput outch){ this.in=inch; this.out=outch; } public void run(){ Integer N; int i; for(i=0;i<10;i=i+1){ N=(Integer)in.read(); out.write(n); } } } HPC H.Nakahara 33

34 SendPassRead public static void main( String[] arg){ One2OneChannel ch1=channel.one2one ( ) ; // ver1.1 One2OneChannel ch2=channel.one2one(); Send send=new Send(ch1.out()); Pass pass=new Pass(ch1.in(),ch2.out()); Read read=new Read(ch2.in()); CSProcess[] csp=new CSProcess[]{send,read,pass}; Parallel Para=new Parallel(csp); Para.run(); } HPC H.Nakahara 34

35 ch1 ch0 Increase Increase ch2 Root Increase Increase Increase HPC H.Nakahara 35

36 Increase class Increase implements CSProcess{ private ChannelInput in ; private ChannelOutput out; public Increase(ChannelInput in,channeloutput out){ this.in=in; this.out=out; } public void run(){ int I, d; Integer ii; for (i=0;i<10;i=i+1){ ii=(integer)in.read(); d=ii.intvalue()+1; out.write( new Integer ( d ) ) ; } } } HPC H.Nakahara 36

37 Root class Root implements CSProcess{ private ChannelOutput out; private ChannelInput in; public Root(ChannelInput in,channeloutput out){ this.out=out; this.in=in; } public void run(){ Integer ii; int i=0; for (i=0;i<10;i=i+1){ ii=new Integer(i); out.write(ii); ii=(integer)in.read(); System.out.println( "data="+ii.intvalue()); } } } HPC H.Nakahara 37

38 Ring100 public static void main(string[] args){ int N=100; // Increase One2OneChannel[] ch=channel.one2onearray(n+1); CSProcess[] CspRing=new CSProcess[N+1]; int i; CspRing[0]=new Root(ch[N].in(),ch[0].out()); // for (i=1;i<=n;i=i+1){ CspRing[i]= new Increase(ch[i-1].in(),ch[i].out()); } Parallel Ring=new Parallel(CspRing); Ring.run(); } } HPC H.Nakahara 38

39 HPC H.Nakahara 39

40 OutSelect Gate (Worker ) Alt Select Worker0 Worker1 WorkerN Alt select HPC H.Nakahara 40

41 Proc3to1 Send0 ch0 Send1 Send2 ch1 ch2 Read HPC H.Nakahara 41

42 Proc3to1 Read public class Read implements CSProcess{ public void run(){ Integer ii; int i; for (i=0;i<10;i=i+1){ ii=(integer)in0.read(); } System.out.println(" 0 data= "+ii.intvalue() ); ii=(integer)in1.read(); System.out.println(" 1 data= "+ii.intvalue() ); ii=(integer)in2.read(); System.out.println(" 2 data= "+ii.intvalue() ); } HPC H.Nakahara 42

43 Alternative Send0 Send1 Send2 ch0 ch1 ch2 Read HPC H.Nakahara 43

44 Alternative class AltselectRead implements CSProcess{ public void run(){ String str ; int i,index; Guard[] gd=new Guard[]{(Guard)in0,(Guard)in1,(Guard)in2}; Alternative alt=new Alternative(gd); for (i=0;i<30;i=i+1){ index=alt.select(); switch(index){ case 0 : str =(String)in0.read() ; break; case 1 : str=(string)in1.read() ; break; case 2 : str=(string)in2.read() ; break; } } fairselect priselect HPC H.Nakahara 44

45 ALT Send0 Send1 Send2 ch0 ch1 ch2 Read HPC H.Nakahara 45

46 cmd_in ON/OFF data_in HPC H.Nakahara 46

47 run public void run(){ Guard[] chng=new Guard[]{cmdin,datain}; Alternative alt=new Alternative(chnG); while(true){ switch(alt.priselect()){ case 0: cmdin.read(); // } } cmdin.read(); // break; case 1: dataout.write(datain.read()) ; // break; HPC H.Nakahara 47 HPC H.Nakahara 47

48 cmd_in data_in HPC H.Nakahara 48

49 Gate Distribute cmd_in data_in Distribute HPC H.Nakahara 49

50 SendForm ActiveCheckbox etc DataOut Gate CSP extensions for all AWT HPC H.Nakahara 50

51 ReadForm ActiveTextField etc DataIn GateFalse CSP extensions for all AWT HPC H.Nakahara 51

52 Send Pass Pass Read 100 : st 1000 Pass =(et - st) / / =(et - st) /100/1000 Pentium4 : 2000MHz : JAVA1.5 12( s) : et HPC H.Nakahara 52

53 CNS P1 ch P2 HPC H.Nakahara 53

54 CNS ch? ch LAN ch? P1 P2 HPC H.Nakahara 54

55 P2P CNS P2P ch LAN P1 P2 P1 P2 HPC H.Nakahara 55

56 Send ch Read HPC H.Nakahara 56

57 public static void main( String[] arg){ One2OneChannel ch=channel.one2one(); Send send=new Send(ch.out()); Read read=new Read(ch.in()); CSProcess[ ] csp=new CSProcess[ ]{send,read}; Parallel Para=new Parallel(csp); Para.run( ); } HPC H.Nakahara 57

58 CNS ch LAN Send Read HPC H.Nakahara 58

59 Send public static void main(string[ ] args ) { System.setProperty( org.jcsp.tcpip.defaultcnsserver", " ") ; try { Node.getInstance().init( ); } catch (NodeInitFailedException e) { System.out.println("Node init failed n" + e); System.exit(-1) ; } new Send ( CNS.createOne2Net ( "ch" ) ). run( ) ; } HPC H.Nakahara 59

60 Read public static void main(string[ ] args ) { System.setProperty( org.jcsp.tcpip.defaultcnsserver", " ") ; try { Node.getInstance().init( ); } catch (NodeInitFailedException e) { System.out.println("Node init failed n" + e); System.exit(-1) ; } new Read ( CNS.createNet2One ( "ch" ) ). run( ) ; } HPC H.Nakahara 60

61 Network One2Net ch Net2One Send Read HPC H.Nakahara 61

62 CNS chan LAN HPC H.Nakahara 62

63 Node A Node C ON/OFF Node B PC Node Node D HPC H.Nakahara 63

64 (J#.NET) CNS chan LAN HPC H.Nakahara 64

65 CPU : Intel Celeron 1300MHz LAN : 100BASE OS : Windows XP : J#.NET ( Visual Studio 2003) int 1/740=1.35 ms HPC H.Nakahara 65

66 HPC H.Nakahara 66

67 .NET CPU : Intel P4 3000MHz LAN : 1000BASE OS : Windows XP : JIBU (C#.NET Visual Studio 2005) 1 2,000 4,000 float ms / HPC H.Nakahara 67

68 1 HPC H.Nakahara 68

69 2 HPC H.Nakahara 69

70 100 JAVA CSP OK CSP extensions for all AWT HPC H.Nakahara 70

71 HPC H.Nakahara 71

72 HPC H.Nakahara 72

73 GUI GUI HPC H.Nakahara 73

74 d 2 x dt 2 + x(t)=0 x(t) = sin(t) HPC H.Nakahara 74

75 HPC H.Nakahara 75

76 run public void run(){ Float xx; float x, y ; float t = 0.0f; while ( t < exetime){ ParIO.run(); xx = ( Float) chin.obj; x = xx.floatvalue(); y = y + x * dt; chout.obj = new Float(y); t = t + dt; } } HPC H.Nakahara 76

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

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

1 Java Java GUI , 2 2 jlabel1 jlabel2 jlabel3 jtextfield1 jtextfield2 jtextfield3 jbutton1 jtextfield1 jtextfield2 jtextfield3

1 Java Java GUI , 2 2 jlabel1 jlabel2 jlabel3 jtextfield1 jtextfield2 jtextfield3 jbutton1 jtextfield1 jtextfield2 jtextfield3 1 2 2 1 2 2.1.................................................... 2 2.2.................................................... 2 2.3........................................ 2 2.4....................................................

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 (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

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

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

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

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

55 7 Java C Java TCP/IP TCP/IP TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] a

55 7 Java C Java TCP/IP TCP/IP TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] a 55 7 Java C Java TCP/IP TCP/IP 7.1 7.1.1 TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] argv) { Socket readsocket = new Socket(argv[0], Integer.parseInt(argv[1]));

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

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

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

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

IE6 2 BMI chapter1 Java 6 chapter2 Java 7 chapter3 for if 8 chapter4 : BMI 9 chapter5 Java GUI 10 chapter6 11 chapter7 BMI 12 chap

IE6 2 BMI chapter1 Java 6 chapter2 Java 7 chapter3 for if 8 chapter4 : BMI 9 chapter5 Java GUI 10 chapter6 11 chapter7 BMI 12 chap 1-1 1-2 IE6 2 BMI 3-1 3-2 4 5 chapter1 Java 6 chapter2 Java 7 chapter3 for if 8 chapter4 : BMI 9 chapter5 Java GUI 10 chapter6 11 chapter7 BMI 12 chapter8 : 13-1 13-2 14 15 PersonTest.java KazuateGame.java

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

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

MPI MPI MPI.NET C# MPI Version2

MPI MPI MPI.NET C# MPI Version2 MPI.NET C# 2 2009 2 27 MPI MPI MPI.NET C# MPI Version2 MPI (Message Passing Interface) MPI MPI Version 1 1994 1 1 1 1 ID MPI MPI_Send MPI_Recv if(rank == 0){ // 0 MPI_Send(); } else if(rank == 1){ // 1

More information

Javaセキュアコーディングセミナー東京 第3回 入出力(File, Stream)と例外時の動作 演習解説

Javaセキュアコーディングセミナー東京 第3回 入出力(File, Stream)と例外時の動作 演習解説 Java セキュアコーディングセミナー東京第 3 回入出力と例外時の動作 演習解説 2012 年 11 月 11 日 ( 日 ) JPCERT コーディネーションセンター脆弱性解析チーム戸田洋三 1 Hands-on Exercises コンパイルエラーに対処しよう ファイルからのデータ入力を実装しよう 2 Hands-on Exercise(1) サンプルコードの コンパイルエラーに対処しよう 3

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

WinHPC ppt

WinHPC ppt MPI.NET C# 2 2009 1 20 MPI.NET MPI.NET C# MPI.NET C# MPI MPI.NET 1 1 MPI.NET C# Hello World MPI.NET.NET Framework.NET C# API C# Microsoft.NET java.net (Visual Basic.NET Visual C++) C# class Helloworld

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

新・明解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

問題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

: : : 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によるアルゴリズムとデータ構造

明解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

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

Programming-C-9.key

Programming-C-9.key プログラミングC 第9回 例外 スレッド 白石路雄 2 finally try{ ( 例外が発生するかもしれない処理 ) catch(exception のクラス名 e){ ( 例外が発生した時の処理 ) finally{ ( 例外の発生の有無に関わらず 必ず行う処理 ) 3 Integer.parseInt() NumberFormatException

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

PowerPoint Presentation

PowerPoint Presentation UML 2004 7 9 10 ... OOP UML 10 Copyright 2004 Akira HIRASAWA all rights reserved. 2 1. 2. 3. 4. UML 5. Copyright 2004 Akira HIRASAWA all rights reserved. 3 1..... Copyright 2004 Akira HIRASAWA all rights

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

< F2D834F838C A815B A CC>

< F2D834F838C A815B A CC> グレゴリー ライプニッツの公式 [Java アプレット ] [Java アプリケーション ] 1. はじめに 次のグレゴリー ライプニッツの公式を用いて π の近似値を求めてみましょう [ グレゴリー ライプニッツの公式 ] π 4 =1-1 3 + 1 5-1 7 + 1 9-1 + 11 シミュレーションソフト グレゴリー ライプニッツの公式による π の近似 を使って π の近似値が求まる様子を観察してみてください

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

A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2:

A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2: Java Jojo ( ) ( ) A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2: Java Jojo Jojo (1) :Globus GRAM ssh rsh GRAM ssh GRAM A rsh B Jojo (2) ( ) Jojo Java VM JavaRMI (Sun) Horb(ETL) ( ) JPVM,mpiJava etc. Send,

More information

< F2D B838A835882CC8CF68EAE2E6A7464>

< F2D B838A835882CC8CF68EAE2E6A7464> ウォーリスの公式 [Java アプレット ] [Java アプリケーション ] 1. はじめに 次のウォーリスの公式を用いて π の近似値を求めてみましょう [ ウォーリスの公式 ] π=2{ 2 2 4 4 6 6 1 3 3 5 5 7 シミュレーションソフト ウォーリスの公式による π の近似 を使って π の近似値が求まる様子を観察してみてください 2.Java アプレット (1) Javaプログラムリスト

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

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

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

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

JAVA とテンプレート

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

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

I HTML HashMap (i) (ii) :.java import java.net.*; import java.io.*; import java.util.hashmap; public class SimpleStopWatch { public static voi

I HTML HashMap (i) (ii) :.java import java.net.*; import java.io.*; import java.util.hashmap; public class SimpleStopWatch { public static voi II Java 10 2 12 10:30 12:00 I. I III II. III. IV. ( a d) V. : this==null, T == N A ActionListener C class D actionperformed G getsource I implements K KeyListener J JApplet L addmouselistener M MouseListener

More information

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

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

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

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

問題1 以下に示すプログラムは、次の処理をするプログラムである 問題 1 次に示すプログラムは 配列 a の値を乱数で設定し 配列 a の値が 333 より大きく 667 以下の値 の合計値を求めるプログラムである 1 と 2 に適切なコードを記述してプログラムを完 成させよ class TotalNumber { public static void main(string[] args) { int[] a = new int[1000]; // 1 解答条件

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

ALG ppt

ALG ppt 2012 7 5 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html (198 ) f(p) p 2 1 2 f 2 53 12 41 69 11 2 84 28 31 63 97 58 76 19 91 88 53 69 69 11 84 84 63

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言語 第1回

Java言語 第1回 Java 言語 第 2 回簡単な Java プログラムの作成と実行 知的情報システム工学科 久保川淳司 kubokawa@me.it-hiroshima.ac.jp 簡単な Java プログラム Java プログラムのファイル名 Java プログラムのファイル名命名ルール ファイル名とクラス名は同じでなければならない HelloJava.java public class HelloJava { public

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

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

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

More information

( ) p.1 x y y = ( x ) 1 γ γ = filtergamma.java import java.applet.*; public class filtergamma extends Applet{ Image img; Image new_img; publi

( ) p.1 x y y = ( x ) 1 γ γ = filtergamma.java import java.applet.*; public class filtergamma extends Applet{ Image img; Image new_img; publi e001d 00 1 1 ( ) Figure 1: 1 shikaku.java import java.applet.*; public class shikaku extends Applet{ public void paint( Graphics g) { g.drawrect(,,0,0 ); // x(,) width = 0,height=0 g.drawrect(,,0,0 );

More information

JavaプログラミングⅠ

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

More information

untitled

untitled Java 1 1 Java 1.1 Java 1.2 Java JavaScript 2 2.1 2.2 2.3 Java VM 3 3.1 3.2 3.3 3.4 4 Java 4.1 Java 4.2 if else 4.3 switch case 4.4 for 4.5 while 4.6 do-while 4.7 break, continue, return 4.8 try-catch-finally

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

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 11.4 PrintWriter 11.5

JAVA 11.4 PrintWriter 11.5 JAVA 11.4 PrintWriter 11.5 PrintWriter Writer Int, float, char Object print() println() tostring() PrintWriter PrintWriter(OutputStream outputstream) PrintWriter(OutputStream outputstream, boolean flushonnewline)

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

< F2D825282CC947B909482CC A815B83682E6A>

< F2D825282CC947B909482CC A815B83682E6A> 3 の倍数のトランプカード 1. はじめに [Java アプレット ] [Java アプリケーション ] ここにトランプが 1 組あります ジョーカー 2 枚を除いて 52 枚を使います 3 の倍数は スペード クローバ ダイヤ ハートに それぞれ 3 と 6 と 9 と 12 の 4 枚ずつあるので 4 4=16 枚あります この 52 枚のトランプから 1 枚引いたとき そのカードが 3 の倍数である確率を考えます

More information

< F2D82518CC282CC D2E6A7464>

< F2D82518CC282CC D2E6A7464> 2 個のさいころ 1. はじめに [Java アプレット ] [Java アプリケーション ] 2 個のさいころを同時に投げたときの目の出方を考えてみましょう この 2 個のさいころをそれぞれ さいころ Ⅰ さいころ Ⅱ とすると その目の出方は順に 1 1 2 1 3 1 4 1 5 1 6 1 1 2 2 2 3 2 4 2 5 2 6 2 1 3 2 3 3 3 4 3 5 3 6 3 1 4

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

明解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

< F2D82B682E182F182AF82F12E6A7464>

< F2D82B682E182F182AF82F12E6A7464> 3 人のじゃんけん [Java アプレット ] [Java アプリケーション ] 1. はじめに A 君 B 君 C 君の 3 人でじゃんけんを 1 回するときの勝ち負けを考えてみましょう あいこの場合は A 君 B 君 C 君の順に グー グー グー チョキ チョキ チョキ パー パー パー グー チョキ パー グー パー チョキ チョキ グー パー チョキ パー グー パー グー チョキ パー

More information

< F2D F B834E2E6A7464>

< F2D F B834E2E6A7464> ランダムウォーク [Java アプレット ] [Java アプレリケーョン ] 1. はじめに 酔っぱらいは前後左右見境なくふらつきます 酔っぱらいは目的地にたどり着こうと歩き回っているうちに何度も同じところに戻って来てしまったりするものです 今 酔っぱらいが数直線上の原点にいるとします 原点を出発して30 回ふらつくとき 30 回目に酔っぱらいがいる位置は 出発点である原点からどれくらい離れてしまっているのでしょうか

More information

Microsoft Word - NonGenTree.doc

Microsoft Word - NonGenTree.doc ジェネリクスとコンパレータを使用しない 2 分探索木のプログラム例 BinTreeNG.java: 2 分探索木のクラス BinTreeNG BinTreeTesterNG.java: BinTreeNG を利用するプログラム例 === BinTreeNG.java =========================================================================

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

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

Java講座

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

More information

ALG2012-C.ppt

ALG2012-C.ppt 2012717 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 1 1. 2. 2 .. 3 public class WeightedNode { private E value; // private Map

More information

オブジェクト脳のつくり方

オブジェクト脳のつくり方 2003 12 16 ( ) ML Java,.NET, UML J2EE, Web Java, J2EE.NET SI ex. ) OO OO OO OO OO (Controller) (Promoter) (Analyzer) (Supporter) http://nba.nikkeibp.co.jp/coachsp.html It takes time. OO OK OO 1.

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

BASIC / / BA- SIC Web 1/10 1/10 / / JavaScript

BASIC / / BA- SIC Web 1/10 1/10 / / JavaScript BASIC / / BA- SIC Web 1/10 1/10 // JavaScript MIT Processing line(10,10,100,100); 1 BASIC / Phidgets 1 GAINER 2 USB / Phidgets USB 1: 1 http://www.phidgets.com/ 2 http://gainer.cc/ / / BGM Phidgets University

More information

(Microsoft PowerPoint - \223\306\217KJAVA\221\346\202R\224\ ppt)

(Microsoft PowerPoint - \223\306\217KJAVA\221\346\202R\224\ ppt) 独習 JAVA 第 3 版 8.4 例外とエラークラス 8.5 throws ステートメント 8.6 独自の例外 Throwable コンストラクタ catch ブロックには Throwable 型のパラメータが必ず 1 つなければならない Throwable コンストラクタ Throwable() Throwable( String message ) message には問題を通知する文字列のメッセージ

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

Prog1_10th

Prog1_10th 2014 年 6 月 19 日 ( 木 ) 実施 例外処理 Java 言語では, 作成したプログラムを実行する際に, 記述した処理が想定しない事態によって実行できなくなる場合を例外と呼び, その例外への対処, 即ち例外処理が求められる 例外処理を行うための try 文の一般形は次のようになる 例外を発生させる可能性のある処理 catch( 例外のクラス名 1 変数 1 ) 例外に対処する処理 1 catch(

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

CD Microsoft, MS-DOS, Windows 95, Windows 98,Windows Me, Windows NT, Windows 2000, Visual Basic, Visual Basic.NET, Visual C#, Excel, ActiveX Microsoft

CD Microsoft, MS-DOS, Windows 95, Windows 98,Windows Me, Windows NT, Windows 2000, Visual Basic, Visual Basic.NET, Visual C#, Excel, ActiveX Microsoft CD Microsoft, MS-DOS, Windows 95, Windows 98,Windows Me, Windows NT, Windows 2000, Visual Basic, Visual Basic.NET, Visual C#, Excel, ActiveX Microsoft Corporation ... iv... v... vi... 1-1 1.1... 1-2 1.2...

More information

SmartLMSユーザーズガイド<講師編>

SmartLMSユーザーズガイド<講師編> SmartLearning Management System SmartLMS (1) (2) (3) (4) (3) (5) Microsoft MS PowerPoint DirectX Windows Windows NT Windows Media Microsoft Corporation Intel Pentium Intel Corporation NEC 2003-2004 NEC

More information

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

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

More information

I. (i) Java? (A). 2Apples (B). Vitamin-C (C). Peach21 (D). Pine_Apple (ii) Java? (A). Java (B). Java (C). Java (D). JavaScript Java JavaScript Java (i

I. (i) Java? (A). 2Apples (B). Vitamin-C (C). Peach21 (D). Pine_Apple (ii) Java? (A). Java (B). Java (C). Java (D). JavaScript Java JavaScript Java (i 12 7 27 10:30 12:00 I. I VI II. III. IV. ( a d) V. VI. 80 100 60 : this==null, T == N A ActionListener A addactionlistener C class D actionperformed E ActionEvent G getsource I implements J JApplet K KeyListener

More information

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics;

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; 19 3!!...... (+) (>) (++) (+=) for while 3.1!! 3.1.1 50 20 20 5 (20, 20) 3.1.1 (1)(Blocks1.java) public class Blocks1 extends JApplet { public void paint(graphics g){ 5 g.drawrect( 20, 20, 50, 20); g.drawrect(

More information

CAC

CAC VOL.24NO.1 61 IMS Transaction 3270 DataBase Transaction OS/370 IMS Traditional Transaction Web Browser Transaction Internet WWW AP IIS APache WebLogic Websphere DataBase Oracle DB2 SQL Server Web Browser

More information

LFA-PC20

LFA-PC20 2-889-816-02(1) LFA-PC20 2006 Sony Corporation ?... 4?... 4?... 5... 7... 8... 8... 11... 11... 13 /... 15 /... 17... 19 /... 19... 29... 31... 31... 32... 33... 34... 35 2 ... 36... 36... 42... 43...

More information

(Java/FX ) Java CD Java version Java VC++ Python Ruby Java Java Eclipse Java Java 3 Java for Everyone 2 10 Java Midi Java JavaFX Shape Canvas C

(Java/FX ) Java CD Java version Java VC++ Python Ruby Java Java Eclipse Java Java 3 Java for Everyone 2 10 Java Midi Java JavaFX Shape Canvas C (Java/FX ) Java CD Java version 10.0.1 Java VC++ Python Ruby Java Java Eclipse Java Java 3 Java for Everyone 2 10 Java Midi Java JavaFX Shape Canvas Canvas Eclipse Eclipse M... 1 javafx e(fx)clipse 3.0.0

More information

LogisticaTRUCKServer-Ⅱ距離計算サーバ/Active-Xコントロール/クライアント 概略   

LogisticaTRUCKServer-Ⅱ距離計算サーバ/Active-Xコントロール/クライアント 概略       - LogisticaTRUCKServer-Ⅱ(SQLServer 版 ) 距離計算サーハ API ソケット通信サンフ ルフ ロク ラム -1- LogisticaTRUCKServer-Ⅱ 距離計算サーハ API ソケット通信 Java でのソケット通信 Javaでのソケット通信の実行サンフ ルフ ロク ラムポート番号は 44963 条件値, 起点, 終点 を送信して 条件値, 起点, 終点,

More information

オブジェクト指向プログラミング・同演習 5月21日演習課題

オブジェクト指向プログラミング・同演習 5月21日演習課題 オブジェクト指向プログラミング 同演習 5 月 21 日演習課題 問題 1 配列の例外処理例外が発生する可能性のある処理を try で囲み その後に catch で例外を捕捉します 例外処理の終了処理として finally が行われます これは書かなくて自動的に行われます 提出課題 1 (Kadai052301.java) 以下のプログラムは例外処理をしていない ArrayIndexOutOfBoundsException

More information

Microsoft Word - NonGenList.doc

Microsoft Word - NonGenList.doc ジェネリクスとコンパレータを使用しないリストのプログラム例 1. ポインタによる線形リスト LinkedListNG.java: ポインタによる線形リストのクラス LinkedListNG LinkedListTesterNG.java: LinkedListNG を利用するプログラム例 2. カーソルによる線形リスト AryLinkedListNG.java: カーソルによる線形リストのクラス AryLinkedListNG

More information

付加情報をもったファイル共有システム

付加情報をもったファイル共有システム 1 2 1 6 1.1....................................... 6 1.2...................................... 6 1.3..................................... 6 1.4................................... 7 2 8 2.1 Annphony....................................

More information

2

2 次の課題 1~7 の を埋めてプログラムを完成させよ 1. 整数型の配列に格納されたデータの総和を計算し, その結果を出力するプログラムである このプログラムの処理手順を次に示す 1 配列の格納するデータの個数 n (n>0) を入力する 2n の大きさで配列を確保する 3 配列に n 個分のデータを格納する 4 配列の総和を求める 5 総和を出力する import java.io.*; public

More information

Express5800/120Ed

Express5800/120Ed Pentium 60% 1. N8500-570A N8500-662 N8500-663 N8500-664 ( /800EB(256)) ( /800EB(256)-9W) ( /800EB(256)-9W2) ( /1BG(256)) Windows NT Server 4.0 Windows 2000 HDD HDD CPU Pentium 800EBMHz1 Pentium 1BGHz1

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

$ 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

Prog2_9th

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

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プログラミングⅠ

JavaプログラミングⅠ Java プログラミング Ⅱ 10 回目への出力 ストリーム ストリームとは入力または出力の流れをもつデータの連鎖ですストリームは異なる機器からのデータを統一的に扱う考え方です 文字ストリーム 文字ベースの入出力をサポートします - Unicode(Java 内部 ) とローカルコード (Java 外部 ) の変換が行われ プログラマはその違いを意識しなくてすみます バイトストリームバイナリデータの入出力をサポートします

More information

InterSafe Personal_v2.3 ユーザーズガイド_初版

InterSafe Personal_v2.3 ユーザーズガイド_初版 InterSafe Personal v2.3 1. 3 1-1. 4 1-2. 5 InterSafe Personal 5 1-3. InterSafe Personal 6 6 7 8 2. 9 2-1. 10 2-2. 14 2-3. 17 17 17 2 18 19 21 3. 22 3-1. 23 23 3-2. [ ] 24 [ ] 24 [ ] 24 3-3. [ ] 25 [ ]

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

コンピュータ中級B ~Javaプログラミング~ 第3回 コンピュータと情報をやりとりするには?

コンピュータ中級B ~Javaプログラミング~  第3回 コンピュータと情報をやりとりするには? Copyright (C) Junko Shirogane, Waseda University 2016, All rights reserved. 1 プログラミング初級 (Java) 第 4 回コンピュータと情報をやりとりするには? 白銀純子 Copyright (C) Junko Shirogane, Waseda University 2016, All rights reserved.

More information