亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gallerypainting.java

?? 該程序有17個(gè)java源文件。是經(jīng)典奧斯波特藝術(shù)品商人軟件工程例子
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
package Osbert;
import java.io.*;

public class GalleryPainting extends Painting
{

  private static double TARGET_MARKUP = 2.15;

  protected String classification;	// gallery classification type
  protected Date   purchaseDate;	// date painting was purchased
  protected Date   saleDate;		// date painting was sold
  protected String sellerName;		// full name of seller
  protected String buyerName;		// full name of painting buyer
  protected String sellerAddr;		// address of seller
  protected String buyerAddr;		// address of buyer
  protected double  algPrice;		// price determined by algorithm
  protected double  purchasePrice;	// actual purchase price
  protected double  targetPrice;	// target selling price
  protected double  sellPrice;		// actual selling price

  // getters-setters for GalleryPainting
  public String getClassification ()		{ return classification; }
  public void   setClassification (String c) { classification = c; }
  public Date   getPurchaseDate ()			{ return purchaseDate; }
  public void   setPurchaseDate (Date d)	{ purchaseDate = d; }
  public Date   getSaleDate ()				{ return saleDate; }
  public void   setSaleDate (Date d)		{ saleDate = d; }
  public String getSellerName ()			{ return sellerName; }
  public void   setSellerName (String n)	{ sellerName = n; }
  public String getBuyerName ()				{ return buyerName; }
  public void   setBuyerName (String n)		{ buyerName = n; }
  public String getSellerAddr ()			{ return sellerAddr; }
  public void   setSellerAddr (String a)	{ sellerAddr = a; }
  public String getBuyerAddr ()				{ return buyerAddr; }
  public void   setBuyerAddr (String a)		{ buyerAddr = a; }
  public double  getAlgPrice ()				{ return algPrice; }
  public void   setAlgPrice (double p)		{ algPrice = p; }
  public double  getPurchasePrice ()		{ return purchasePrice; }
  public void   setPurchasePrice (double p)	{ purchasePrice = p; }
  public double  getTargetPrice ()			{ return targetPrice; }
  public void   setTargetPrice (double p)	{ targetPrice = p; }
  public double  getSellPrice ()			{ return sellPrice; }
  public void   setSellPrice (double p)		{ sellPrice = p; }


  public void getGalleryInformation ()
  //
  //	 retrieves gallery painting information
  //
  {
	System.out.println("\n");

	purchaseDate = Date.currentDate;

	System.out.print("Enter the NAME of the seller: ");
    sellerName = UserInterface.getString();

	System.out.print("Enter the ADDRESS of the seller: ");
    sellerAddr = UserInterface.getString();

	System.out.print("Enter the purchase PRICE of the painting: ");
	purchasePrice = UserInterface.getDouble();

	targetPrice = purchasePrice * TARGET_MARKUP;

  } // getGalleryInformation

//	-------------------------------------------------------------------------------------------------------------------

  public void addNewPainting ()
  //
  //	 inserts a gallery object in the proper place
  //
  throws IOException {

	DataInputStream  inTmp, inCopy;			// stream objects used for file input
    DataOutputStream outTmp, outCopy;		// stream objects used for file output
    boolean found = false;			        // indicates if object insertion point found
	GalleryPainting	tempGallery;	        // temporary object used for file copying

    inTmp  = new DataInputStream(new BufferedInputStream(new FileInputStream("gallery.dat")));
    outTmp = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("tempG.dat")));
    tempGallery = new GalleryPainting();

	  //
	  // copy the current gallery file to a temporary file
	  //
	  while (inTmp.available() != 0)
	  {
		  //
		  // read the temporary gallery object from the gallery file
		  //
		  tempGallery.readBought (inTmp);

		  //
		  // write the temporary gallery object to a temporary file
		  //
		  tempGallery.writeBought (outTmp);
	  }

	inTmp.close ();
	outTmp.close ();

	inCopy  = new DataInputStream(new BufferedInputStream(new FileInputStream("tempG.dat")));
	outCopy = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("gallery.dat")));

	  //
	  // copy the temporary file to new gallery file
	  // while inserting the gallery object in the proper location
	  //
	  while  (inCopy.available() != 0)
	  {
		  //
		  // read a temporary gallery object from the temporary file
		  //
		  tempGallery.readBought (inCopy);

		  //
		  // write the proper object to the gallery file
		  //
		  if ((classification.compareTo(tempGallery.classification) <= 0) &&
			  (purchaseDate.compare(tempGallery.purchaseDate) <= 0) && !found)
		  {
			  //
			  // write the gallery爋bject to the gallery file
			  //
			  writeBought (outCopy);

			  //
			  // write the temporary gallery object to the gallery file
			  //
			  tempGallery.writeBought (outCopy);
			  found = true;

		  }
		  else
			  tempGallery.writeBought (outCopy);


	  } // while  (inCopy.available() != 0)

    //
    // write the gallery object to the end of the gallery file
    //
    if (!found)
 	  writeBought (outCopy);

    inCopy.close ();
    outCopy.close ();

  } // addNewPainting

//	-------------------------------------------------------------------------------------------------------------------

  public void buy ()
  //
  //	 allows user to buy a painting
  //
  throws IOException {

    DataInputStream inFile;			// stream object used for file input
    char ch;						// holds user response to Y/N question
    boolean found = false;			// indicates if painting already in gallery
    GalleryPainting	tempGallery;	// temporary object used for file reading

    getDescription ();

	inFile = new DataInputStream(new BufferedInputStream(new FileInputStream("gallery.dat")));
    tempGallery = new GalleryPainting();

	  //
	  // determine if the gallery object already exists in the gallery
	  //
	  while (inFile.available() != 0)
	  {
		//
		// read a temporary gallery object from the gallery file
		//
		tempGallery.readBought (inFile);

		//
		// check if there is a match with the gallery object
        //
	    if ((UserInterface.compareStr (tempGallery.firstName, firstName) == 0) &&
	        (UserInterface.compareStr (tempGallery.lastName, lastName) == 0) &&
		    (UserInterface.compareStr (tempGallery.title, title) == 0))
	    {
		  found = true;
		  break;
        }

	  } // while (inFile.available() != 0)

    inFile.close ();

	if (found == true)
	{
      System.out.println("\n\nThe painting you described has already been purchased!\n");
    }
	else
	{

	  if(classification.compareTo("Masterpiece") == 0)
		  algPrice = ComputeMasterpiecePrice.getAlgorithmPrice(this);
	  if(classification.compareTo("Masterwork") == 0)
		  algPrice = ComputeMasterworkPrice.getAlgorithmPrice(this);
	  if(classification.compareTo("Other") == 0)
		  algPrice = ComputeOtherPrice.getAlgorithmPrice(this);

	  System.out.println("\n");

	  if (algPrice > 0)
	  {
	    System.out.println("The algorithm has determined the maximum offering price to be:");
	    System.out.println("$" + algPrice + " million dollars.\n");

	    System.out.print("Do you want to purchase this painting (Y/N)? ");

	    ch = UserInterface.getChar();

	    if ((ch == 'Y') || (ch == 'y'))
	    {
		  getGalleryInformation();
		  addNewPainting();
	    }
	  }
	  else
		  System.out.println("The algorithm has suggested that you should not buy this painting.");
	}

	System.out.println();
    System.out.println("\n\n Press <ENTER> to return to main menu...");
	UserInterface.pressEnter();

  } // buy

//	-------------------------------------------------------------------------------------------------------------------

  public void readBought (DataInputStream fileName) // stream object where gallery information is read
  //
  //	 reads a gallery object from fileName
  //     Note: Java serialization could be used as an alternative to this approach
  //
  throws IOException {

	String tempDate;

	classification = fileName.readUTF();
	firstName = fileName.readUTF();
	lastName = fileName.readUTF();
	title = fileName.readUTF();
	tempDate = fileName.readUTF();
	paintingDate = new Date();
	paintingDate.parseDate(tempDate);
	tempDate = fileName.readUTF();
	purchaseDate = new Date();
	purchaseDate.parseDate(tempDate);
	medium = fileName.readUTF();
	subject = fileName.readUTF();
	sellerName = fileName.readUTF();
	sellerAddr = fileName.readUTF();
	algPrice = fileName.readDouble();
	purchasePrice = fileName.readDouble();
	targetPrice = fileName.readDouble();
	height = fileName.readDouble();
	width = fileName.readDouble();

  } // readBought

//	-------------------------------------------------------------------------------------------------------------------

  public void writeBought (DataOutputStream fileName) // stream object where gallery information is written
  //
  //	 writes a gallery object to fileName
  //     Note: Java serialization could be used as an alternative to this approach
  //
  throws IOException {
	if(classification.length() > 0)
	{
	  fileName.writeUTF(classification);
	  fileName.writeUTF(firstName);
	  fileName.writeUTF(lastName);
	  fileName.writeUTF(title);
	  fileName.writeUTF(paintingDate.toString());
	  fileName.writeUTF(purchaseDate.toString());
	  fileName.writeUTF(medium);
	  fileName.writeUTF(subject);
	  fileName.writeUTF(sellerName);
	  fileName.writeUTF(sellerAddr);
	  fileName.writeDouble(algPrice);
	  fileName.writeDouble(purchasePrice);
	  fileName.writeDouble(targetPrice);
	  fileName.writeDouble(height);
	  fileName.writeDouble(width);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩三级在线观看| 欧美大片在线观看| 久久精品99国产精品| 国产清纯白嫩初高生在线观看91| 精品视频1区2区3区| 国产精品18久久久久久vr| 亚洲自拍偷拍九九九| 国产亚洲欧美激情| 欧美一级在线观看| 91福利区一区二区三区| 成人精品视频.| 久久国产精品99久久久久久老狼| 亚洲精品免费电影| 欧美精彩视频一区二区三区| 欧美一级二级三级乱码| 欧美午夜一区二区三区免费大片| 成人一级视频在线观看| 美女www一区二区| 亚洲国产成人av| 亚洲男人的天堂av| 国产精品看片你懂得| 久久久久久久久久美女| 91精品国产综合久久精品性色| 91丨porny丨国产入口| 日韩一区二区三区免费看| 色94色欧美sute亚洲13| 91女神在线视频| 懂色av一区二区夜夜嗨| 黄网站免费久久| 久久激情五月激情| 免费一区二区视频| 日产国产欧美视频一区精品| 亚洲成人免费看| 亚洲一区二区三区不卡国产欧美| 亚洲精品视频免费看| 亚洲欧美一区二区在线观看| 一区视频在线播放| 国产精品久线在线观看| 日韩一区在线播放| 亚洲欧洲制服丝袜| 亚洲欧美日本在线| 亚洲精品中文字幕在线观看| 中文字幕一区二区在线观看 | 成人av在线一区二区三区| 国产精品中文字幕一区二区三区| 极品少妇xxxx精品少妇偷拍| 久久69国产一区二区蜜臀| 精品系列免费在线观看| 国产一区二区0| 国产91精品欧美| 99视频在线精品| 色综合天天天天做夜夜夜夜做| 9久草视频在线视频精品| 91美女片黄在线观看91美女| 欧美天堂一区二区三区| 7777精品伊人久久久大香线蕉 | 亚洲色图19p| 亚洲麻豆国产自偷在线| 亚洲国产成人porn| 另类的小说在线视频另类成人小视频在线| 蜜臀av亚洲一区中文字幕| 国产在线观看一区二区| 成人免费高清在线| 99精品久久免费看蜜臀剧情介绍 | 久久嫩草精品久久久精品| 久久夜色精品一区| 国产精品网站在线播放| 亚洲欧美色综合| 亚洲bt欧美bt精品| 精品一区二区精品| aaa欧美大片| 555夜色666亚洲国产免| 久久婷婷成人综合色| 成人免费在线视频| 日韩激情在线观看| 国产99久久久国产精品潘金 | 国产精品沙发午睡系列990531| 亚洲激情自拍偷拍| 蜜桃精品视频在线| 9久草视频在线视频精品| 国产精品久久久久一区| 三级久久三级久久| 成人做爰69片免费看网站| 91电影在线观看| 精品国产一区二区三区忘忧草| 国产精品免费久久| 日本午夜一区二区| 92精品国产成人观看免费| 欧美精品久久99| 国产精品久久久久一区二区三区| 午夜精品一区在线观看| 国产91精品精华液一区二区三区 | 欧美日韩国产综合久久| 久久精子c满五个校花| 图片区日韩欧美亚洲| 国产成人精品免费视频网站| 欧美日韩一区视频| 国产精品国产三级国产普通话三级| 肉色丝袜一区二区| 色婷婷av一区二区三区gif| 精品粉嫩超白一线天av| 亚洲午夜久久久| 成人黄色777网| 精品久久人人做人人爽| 婷婷综合另类小说色区| 99精品视频在线播放观看| 日韩欧美的一区| 亚洲超碰97人人做人人爱| a4yy欧美一区二区三区| 国产亚洲精品aa| 奇米在线7777在线精品| 欧美性xxxxx极品少妇| 1区2区3区国产精品| 国产呦萝稀缺另类资源| 欧美一区二区大片| 亚洲国产精品自拍| 国产精品卡一卡二| 国产精品一区久久久久| 日韩欧美的一区二区| 日日摸夜夜添夜夜添亚洲女人| 欧美在线观看视频一区二区三区| 国产精品久久久久久久久图文区| 国产一区欧美二区| 精品国产一区二区三区四区四 | 久久国产夜色精品鲁鲁99| 欧美午夜精品久久久久久超碰| 亚洲欧洲av另类| 国产suv一区二区三区88区| 久久色视频免费观看| 久久狠狠亚洲综合| 精品区一区二区| 久久爱www久久做| 日韩午夜精品电影| 久久97超碰色| 久久久亚洲精品石原莉奈| 国模一区二区三区白浆| 精品日韩在线观看| 国产伦精一区二区三区| 久久综合九色综合欧美就去吻| 美女视频黄a大片欧美| 日韩写真欧美这视频| 国产成人自拍网| 一区二区三区中文免费| 欧美亚洲另类激情小说| 日韩国产欧美在线视频| 中文字幕在线视频一区| 日本一区二区三区dvd视频在线 | 美国十次综合导航| 蜜桃在线一区二区三区| 久久不见久久见免费视频1| 欧美丝袜丝交足nylons| 精品一区二区三区免费观看| 亚洲三级在线免费观看| 欧美丰满一区二区免费视频| 国产电影精品久久禁18| 一级日本不卡的影视| 精品久久久久香蕉网| 色综合中文字幕国产 | 成人动漫一区二区在线| 日韩成人一区二区三区在线观看| 欧美激情一区二区三区不卡| 制服丝袜日韩国产| gogo大胆日本视频一区| 蜜臀91精品一区二区三区| 亚洲激情自拍偷拍| 国产三区在线成人av| 在线观看91av| 色婷婷综合久久久中文一区二区| 狠狠色综合播放一区二区| 夜夜爽夜夜爽精品视频| 国产欧美精品一区| 欧美高清你懂得| 91免费看`日韩一区二区| 久久成人免费电影| 亚洲va天堂va国产va久| 中文字幕一区二区不卡 | 日韩高清不卡一区| 亚洲男人的天堂网| 国产精品视频一区二区三区不卡| 欧美一区二区高清| 欧美亚洲另类激情小说| 91网站最新网址| 粉嫩嫩av羞羞动漫久久久| 蜜臀久久久久久久| 亚洲成人av在线电影| 亚洲天堂成人在线观看| 久久久99精品久久| 久久综合九色综合97婷婷女人| 欧美一区二区在线观看| 欧美三级韩国三级日本三斤| 波多野结衣91| 风间由美性色一区二区三区| 精品一区二区三区免费| 毛片av一区二区三区| 日韩黄色小视频| 首页国产欧美久久| 亚洲国产精品天堂| 亚洲高清在线视频| 亚洲成人免费看| 亚洲1区2区3区4区|