<?xml version="1.0" encoding="UTF-8" ?><rdf:RDF 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:lang="ja">
  <channel rdf:about="http://w.atwiki.jp/bz521717/">
    <title>bz521717 @ ウィキ</title>
    <link>http://w.atwiki.jp/bz521717/</link>
    <atom:link href="https://w.atwiki.jp/bz521717/rss10.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsubhubbub.appspot.com" />
    <description>bz521717 @ ウィキ</description>

    <dc:language>ja</dc:language>
    <dc:date>2009-12-11T16:56:10+09:00</dc:date>
    <utime>1260518170</utime>

    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="https://w.atwiki.jp/bz521717/pages/39.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bz521717/pages/38.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bz521717/pages/37.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bz521717/pages/36.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bz521717/pages/35.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bz521717/pages/34.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bz521717/pages/33.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bz521717/pages/32.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bz521717/pages/31.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/bz521717/pages/29.html" />
              </rdf:Seq>
    </items>
	
		
    
  </channel>
    <item rdf:about="https://w.atwiki.jp/bz521717/pages/39.html">
    <title>チャレンジ3</title>
    <link>https://w.atwiki.jp/bz521717/pages/39.html</link>
    <description>
      class Square{
     // インスタンス変数の定義
     private int height; //縦の辺の長さ
     private int width; //横の辺の長さ
     private int s;//面積

     // 縦の辺の長さと横の辺の長さを引数にもつコンストラクタの定義
     //****** ここにコンストラクタの定義を追加します *********
     Square(int h,int w){
    	 height=h;//縦の辺の長さセット
    	 width=w;//横の辺の長さセット
     }

     // getAreaメソッドの定義 戻り値は四角形の面積とする
     //****** ここにgetAreaメソッドの定義を追加します*********
     void   getArea(){

    	 s=height*width;
     }
   //辺の縦と横の長さの表示,面積の表示
     void getData(){
    	 System.out.print(&quot;縦：&quot;+ height+&quot;cm\t&quot;);
    	 System.out.println(&quot;横：&quot;+ width+&quot;cm&quot;);
    	 System.out.println(&quot;四角形の面積は&quot;+s+&quot;平方センチメートルです。&quot;);
     }
}

class Exercises {
     public static void main(String[] args) {

    	 try{
    	 if(args.length==2){ //コマンドライン引数の個数が2つのとき

        	  int i,j;


               //****** 以下のコメントに対応するコードを追加し処理を完成させます *******
               //Squareクラス型オブジェクトの作成
               //コマンドライン引数から入力された数値を縦、横の辺の長さとして使用する
               //SquareクラスのgetAreaメソ    </description>
    <dc:date>2009-12-11T16:56:10+09:00</dc:date>
    <utime>1260518170</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bz521717/pages/38.html">
    <title>チャレンジ2</title>
    <link>https://w.atwiki.jp/bz521717/pages/38.html</link>
    <description>
      class Square{
     // インスタンス変数の定義
     private int height; //縦の辺の長さ
     private int width; //横の辺の長さ
     private int s;//面積

     // 縦の辺の長さと横の辺の長さを引数にもつコンストラクタの定義
     //****** ここにコンストラクタの定義を追加します *********
     Square(int h,int w){
    	 height=h;//縦の辺の長さセット
    	 width=w;//横の辺の長さセット
     }

     // getAreaメソッドの定義 戻り値は四角形の面積とする
     //****** ここにgetAreaメソッドの定義を追加します*********
     void   getArea(){

    	 s=height*width;
     }
   //辺の縦と横の長さの表示,面積の表示
     void getData(){
    	 System.out.print(&quot;縦：&quot;+ height+&quot;cm\t&quot;);
    	 System.out.println(&quot;横：&quot;+ width+&quot;cm&quot;);
    	 System.out.println(&quot;四角形の面積は&quot;+s+&quot;平方センチメートルです。&quot;);
     }
}

class Exercises {
     public static void main(String[] args) {
          if(args.length==2){ //コマンドライン引数の個数が2つのとき

        	  int i,j;


               //****** 以下のコメントに対応するコードを追加し処理を完成させます *******
               //Squareクラス型オブジェクトの作成
               //コマンドライン引数から入力された数値を縦、横の辺の長さとして使用する
               //SquareクラスのgetAreaメソッドを利用して四角形    </description>
    <dc:date>2009-12-11T16:47:42+09:00</dc:date>
    <utime>1260517662</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bz521717/pages/37.html">
    <title>チャレンジ1</title>
    <link>https://w.atwiki.jp/bz521717/pages/37.html</link>
    <description>
      ＊補足説明

以前のプログラム（Error2.java）ではSumupStudent→Error2
で作っていましたがSumupStudentのままでも問題なく動くので今回は変更しないで作成しました。

＊注意
このプログラムをコンパイルするときには
javac Error2.java
プログラムを動かす時には
java SumupStudent
となるので注意してください。



//課題2-2 エラー箇所を見つけて修正しよう！

class Student {
	//インスタンス変数の宣言
	private String name;	//名前
	private int[] result = new int[3];   //テストの点数格納配列（数学、化学、物理）
	private float total=0;	//合計点
	private float ave=0;	//平均点
	//コンストラクタ(Java絵本P74)
	public Student(String who, int math, int chemistry, int physics){
		//インスタンス変数への値の代入
		name = who;
		result[0] = math;
		result[1] = chemistry;
		result[2] = physics;
	}

	//学生の名前の取得
	public String getName(){
		return name;
	}

	//各科目の点数の取得
	public int getResult(int num){
		return result[num];
	}

	//合計点の取得
	public float getTotal(){
		//合計点の初期化
		total = 0;
		for(int i=0; i&lt;result.length; i++){
			 total = total + result[i];
		}
		return total;
	}
	//平均点の取得
	public float getAve(){
		ave = 0;
		if(total!=0){
			ave=total/r    </description>
    <dc:date>2009-12-11T17:08:00+09:00</dc:date>
    <utime>1260518880</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bz521717/pages/36.html">
    <title>チャレンジ</title>
    <link>https://w.atwiki.jp/bz521717/pages/36.html</link>
    <description>
      -[[チャレンジ1]]
-[[チャレンジ2]]
-[[チャレンジ3]]    </description>
    <dc:date>2009-12-11T16:55:59+09:00</dc:date>
    <utime>1260518159</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bz521717/pages/35.html">
    <title>☆実習課題☆ 6-1</title>
    <link>https://w.atwiki.jp/bz521717/pages/35.html</link>
    <description>
      import java.io.*;

class FileCopy{
	public static void main(String args[]){
		int b;

		if (args.length != 2) {
			System.err.println(&quot;読み込みファイルと書き込みファイルをそれぞれ入力してください&quot;);
		System.exit(-1);
		}
		try {
			// バイト・ストリームの獲得（ファイルのオープン）
			FileOutputStream fos = new FileOutputStream(args[1]);//書き込みファイル　コピー先ファイル
			FileInputStream fis = new FileInputStream(args[0]);//読み込みファイル　コピー元ファイル
			while ((b = fis.read()) != -1) {
				System.out.println(b); // 読み込んだデータの表示
				fos.write(b);//読み込んだデータを書き込む
			}
			System.out.println(&quot;- - 読み込み完了- -&quot;);
			fis.close(); // ストリームのクローズ（ファイルのクローズ）
			fos.close();//ストーリムのクローズ
		}
		catch (FileNotFoundException e){
			System.err.println(&quot;ファイルが見つかりませんでした&quot;);
		}
		catch (IOException e) {
			System.err.println(&quot;ファイルのオープン・クローズまたは書き込みに失敗しました&quot;);
			e.printStackTrace();
		}
	}
}    </description>
    <dc:date>2009-11-01T00:26:36+09:00</dc:date>
    <utime>1257002796</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bz521717/pages/34.html">
    <title>☆実習課題☆ 5-1</title>
    <link>https://w.atwiki.jp/bz521717/pages/34.html</link>
    <description>
      class MyRunnable implements Runnable{
	String name;
	// コンストラクタ
	public MyRunnable(String s){
	name = s;
	}
	// オーバーライドされたrunメソッド
	public void run(){
		while(true){
			System.out.println(name);
		}
	}
}

class MyRunnableApp{
	public static void main(String args[]){
	// スレッドの作成
	MyRunnable r1 = new MyRunnable(&quot;Runnable1&quot;);
	Thread t1 = new Thread(r1);
	MyRunnable r2 = new MyRunnable(&quot;Runnable2&quot;);
	Thread t2 = new Thread(r2);
	MyRunnable r3 = new MyRunnable(&quot;Runnable3&quot;);
	Thread t3 = new Thread(r3);
	// スレッドの実行開始
	t1.start();
	t2.start();
	t3.start();
	}
}    </description>
    <dc:date>2009-10-30T23:16:14+09:00</dc:date>
    <utime>1256912174</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bz521717/pages/33.html">
    <title>☆実習課題☆ 4-1</title>
    <link>https://w.atwiki.jp/bz521717/pages/33.html</link>
    <description>
      import jp.co.jip.st.common.*;//パッケージのインポート

class CheckDaysTest{
	int Seireki,Tsuki,Hinichi;
	public static void main(String args[]) {
	try{
		CheckDays cd=new CheckDays(args[0],args[1]);
		cd.setData();
		cd.Data();
		cd.getData();
		System.out.println();
		System.out.println(&quot;例外発生時にはこの行は出力されません&quot;);
	}
	catch(ArrayIndexOutOfBoundsException e){
		System.out.println(&quot;引数は&lt;西暦&gt;と&lt;年&gt;の2 つです&quot;);
		}
		catch(NumberFormatException e){
		System.out.println(&quot;数値に変換できない型です&quot;);
		}
		catch(Exception e){
		System.out.println(&quot;例外：すべての例外をキャッチします&quot;);
		System.out.println(&quot;例外：&quot; + e.getMessage());
           //UserException2をExceptionに継承しているためe.getMessage()で予期せぬエラーが発生しましたが表示される
		}
		finally{
		System.out.println(&quot;この行は例外に関わらず出力されます&quot;);
		}
	}
}

package jp.co.jip.st.common;//パッケージ化

public class CheckDays{

	int Seireki,Tsuki,Hinichi;
	String seireki,tsuki;
	 public CheckDays(String a,String b){
		 seireki=a;
		 tsuki=b;
	 }
		public void setData()throws UserException2{
    </description>
    <dc:date>2009-10-28T15:57:39+09:00</dc:date>
    <utime>1256713059</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bz521717/pages/32.html">
    <title>☆実習課題☆ 3-3</title>
    <link>https://w.atwiki.jp/bz521717/pages/32.html</link>
    <description>
      もっと簡単に作れるかもしれません。

class Book{//スーパークラス

	String Name;
	String Author;

	Book(String name,String author){
		Name=name;
		Author=author;
	}


	void print(){
		System.out.println(&quot;タイトル  ：&quot;+Name);
		System.out.println(&quot;著者  :&quot;+Author);
	}
}

class BookSales extends Book{//スーパークラスに継承

	String Year;
	String Price;


	BookSales(String name,String author,String year,String price){
		super(name,author);
		Year=year;
		Price=price;
	}
	void print(){
		super.print();
		System.out.println(&quot;出版年 :&quot;+Year);
		System.out.println(&quot;価格 :&quot;+Price);
	}
}

class BookShow{
	public static void main(String args[]){

		switch (args.length){

		case 2://タイトル、著者名を記入したとき
			Book b=new Book(args[0],args[1]);
			b.print();
			break;
		case 4://タイトル、著者名、出版年、価格を記入したとき
			Book bs=new BookSales(args[0],args[1],args[2],args[3]);
			bs.print();
				break;
		default://case 2 case 4の両方とも満たしていないとき
			System.out.print(&quot;タイトル　著者名　かタイトル　著者名　出版年　価格　のどちらかで記入してください&quot;);

		}
	}
}    </description>
    <dc:date>2009-10-25T12:11:06+09:00</dc:date>
    <utime>1256440266</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bz521717/pages/31.html">
    <title>☆実習課題☆ 3-1</title>
    <link>https://w.atwiki.jp/bz521717/pages/31.html</link>
    <description>
      class MyEmp1{ 
	
	static String empNo; 
	static String empName; 
	
	static void setData(String no,String name){ 
		empNo=no; 
		empName=name; 
	} 
	static void getData(){ 
		System.out.println(&quot;社員番号: &quot; + empNo); 
		System.out.println(&quot;社員名: &quot; + empName);
	} 
	public static void main(String args[]){ 
		setData(args[0],args[1]);
		getData();
	} 
}     </description>
    <dc:date>2009-10-25T01:56:48+09:00</dc:date>
    <utime>1256403408</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/bz521717/pages/29.html">
    <title>☆実習課題☆ 3-2</title>
    <link>https://w.atwiki.jp/bz521717/pages/29.html</link>
    <description>
      class Food{
	String Name;
	int Tanka,goukei,Kosuu;
	void setData(String name,String tanka){
		Name=name;
		Tanka=Integer.parseInt(tanka);
		goukei=Tanka;
	}
	void setData(String name,String tanka,String kosuu){
		Name=name;
		Tanka=Integer.parseInt(tanka);
		Kosuu=Integer.parseInt(kosuu);
		goukei=Tanka*Kosuu;
	}
	void printprice(){
		System.out.println(&quot;お買い上げの商品  :&quot;+Name);
		System.out.println(&quot;単価 :&quot;+Tanka);
		System.out.println(&quot;合計金額  :&quot;+goukei);
	}
}

class FoodGet{
	public static void main(String args[]){
		Food food=new Food();
          switch (args.length){
                   case 2:
			food.setData(args[0],args[1]);
			break;
                   case 3:
			food.setData(args[0],args[1],args[2]);
			break;
			default:
		}
		food.printprice();
	}
}    </description>
    <dc:date>2009-10-25T00:35:13+09:00</dc:date>
    <utime>1256398513</utime>
  </item>
  </rdf:RDF>
