📄 shippingcalculator.java
字号:
package quickstart;
import java.util.ArrayList;
import java.util.List;
import java.lang.Math;
/*
////////////////////////////////////////////////////////////////////////////////
// ADOBE SYSTEMS INCORPORATED
// Copyright 2007 Adobe Systems Incorporated
// All Rights Reserved.
//
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
// terms of the Adobe license agreement accompanying it. If you have received this file from a
// source other than Adobe, then your use, modification, or distribution of it requires the prior
// written permission of Adobe.
////////////////////////////////////////////////////////////////////////////////
*/
public class ShippingCalculator {
/* Returns a list of made-up ShippingOptions.
*/
public List getShippingOptions(int zipcode, double pounds) {
List options = new ArrayList();
double baseCost;
baseCost = Math.round(zipcode / 10000) + (pounds * 5);
options.add(new ShippingOption("Next Day", baseCost * 4));
options.add(new ShippingOption("Two Day Air", baseCost * 2));
options.add(new ShippingOption("Saver Ground", baseCost));
return options;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -