📄 computemasterworkprice.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 + -