⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 computemasterworkprice.java

📁 该程序有17个java源文件。是经典奥斯波特艺术品商人软件工程例子
💻 JAVA
字号:
package Osbert;

import java.io.*;

public class ComputeMasterworkPrice
{

  public static double getAlgorithmPrice (GalleryPainting masterwork)
  //
  // determines the maximum price to be offered for a masterwork
  //
  throws IOException {

    int	century;	        // century in which painting was created
    double masterpiecePrice;	// value if masterpiece

	//
	// first, compute the price of the painting as if it were a masterpiece
	//
	masterpiecePrice = ComputeMasterpiecePrice.getAlgorithmPrice (masterwork);

	//
	// next, obtain the century in which the painting was created and adjust
	// the price based upon the century
	//
	century = masterwork.getPaintDate().getYear() / 1000;

	if (century == 19)
		return masterpiecePrice * 0.25;
	else
		return masterpiecePrice * (21 - century) / (22 - century);

  } // getAlgorithmPrice

} // class ComputeMasterworkPrice

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -