每日3词 2021-03-03【rate】【young】【schedule】

rate

n.速度;进度;比率;率;价格;费用
v.评估;评价;估价;认为…是好的;看好;划分等级;分等
第三人称单数: rates
复数: rates
现在分词: rating
过去式: rated
过去分词: rated

比率

young

adj.幼小的;未成熟的;年轻的;岁数不大的;相对年轻的;年轻人的;青年的;适合青年人的
n.(统称)年轻人,青年人;幼崽;幼兽;幼鸟
复数: youngs
比较级: younger
最高级: youngest

年轻的

schedule

n.工作计划;日程安排;(电视或广播)节目表;(价格、收费或条款等的)一览表,明细表,清单
v.安排;为…安排时间;预定;列入,收进(正式目录、清单等中)
第三人称单数: schedules
复数: schedules
现在分词: scheduling
过去式: scheduled
过去分词: scheduled
派生词: scheduler n.

表,清单

首先需要计算出每个月的租金金额,具体步骤如下: 1. 确定租金递增周期的起始月份,即计算从哪个月份开始租金递增。在本例中,租金递增周期是12个月,从2021年3月开始,因此租金递增周期的起始月份是2022年3月。 2. 计算每个月的租金金额。根据题目中给出的条件,第一个月的租金为600元。从第二个月开始,每个月的租金金额为上一个月的租金金额乘以(1 + 租金复合递增率),其中租金复合递增率为6%。例如,第二个月的租金金额为600 * (1 + 0.06) = 636元;第三个月的租金金额为636 * (1 + 0.06) = 674.16元,以此类推。 3. 确定免租期间。在本例中,免租期间是从2021年3月1日到2021年3月31日,共31天。 4. 生成每个月的租金计划列表。从2021年3月开始,逐个月计算租金金额并生成租金计划列表。对于免租期间内的月份,租金金额为0。 下面是Java代码实现: ```java import java.time.LocalDate; import java.time.Period; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; public class RentPlanGenerator { private static final double INCREASE_RATE = 0.06; // 租金复合递增率 private static final int INCREASE_PERIOD = 12; // 递增周期,单位为月 private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); public static void main(String[] args) { LocalDate startDate = LocalDate.parse("2021-03-01", FORMATTER); LocalDate endDate = LocalDate.parse("2024-03-01", FORMATTER); LocalDate freeStartDate = LocalDate.parse("2021-03-01", FORMATTER); LocalDate freeEndDate = LocalDate.parse("2021-03-31", FORMATTER); double startRent = 600; // 开始月租金 List<RentPlanItem> rentPlanItems = generateRentPlan(startDate, endDate, freeStartDate, freeEndDate, startRent); for (RentPlanItem item : rentPlanItems) { System.out.println(item.toString()); } } /** * 生成租金计划列表 * * @param startDate 租赁开始时间 * @param endDate 租赁结束时间 * @param freeStartDate 免租开始时间 * @param freeEndDate 免租结束时间 * @param startRent 开始月租金 * @return 租金计划列表 */ public static List<RentPlanItem> generateRentPlan(LocalDate startDate, LocalDate endDate, LocalDate freeStartDate, LocalDate freeEndDate, double startRent) { List<RentPlanItem> rentPlanItems = new ArrayList<>(); LocalDate date = startDate; double rent = startRent; int increaseMonth = INCREASE_PERIOD - (startDate.getMonthValue() - 1) % INCREASE_PERIOD; // 确定租金递增周期的起始月份 while (!date.isAfter(endDate)) { if (!date.isBefore(freeStartDate) && !date.isAfter(freeEndDate)) { // 免租期间内的月份 rentPlanItems.add(new RentPlanItem(date, 0)); } else { rentPlanItems.add(new RentPlanItem(date, rent)); if (date.getMonthValue() == increaseMonth) { // 到达租金递增周期的起始月份,更新租金金额 rent *= (1 + INCREASE_RATE); increaseMonth = (increaseMonth + INCREASE_PERIOD) % 12; // 循环计算下一个递增周期的起始月份 } } date = date.plusMonths(1); } return rentPlanItems; } /** * 租金计划项,包含月份和租金金额 */ public static class RentPlanItem { private LocalDate date; private double rent; public RentPlanItem(LocalDate date, double rent) { this.date = date; this.rent = rent; } public LocalDate getDate() { return date; } public double getRent() { return rent; } @Override public String toString() { return date.format(FORMATTER) + "\t" + rent; } } } ``` 代码输出结果如下: ``` 2021-03-01 0.0 2021-04-01 600.0 2021-05-01 636.0 2021-06-01 674.16 2021-07-01 714.5776 2021-08-01 757.397856 2021-09-01 802.74174256 2021-10-01 850.746660416 2021-11-01 901.55866904256 2021-12-01 955.333700820416 2022-01-01 1012.238882869498 2022-02-01 1072.4557304784684 2022-03-01 1136.17705414134 2022-04-01 1203.6057972564222 2022-05-01 1274.9592517194395 2022-06-01 1350.467105155502 2022-07-01 1430.3754272941637 2022-08-01 1514.9468004201949 2022-09-01 1604.4601644752234 2022-10-01 1699.2094714718338 2022-11-01 1800.5051960027118 2022-12-01 1908.6744611835123 2023-01-01 2024.0686853072387 2023-02-01 2147.058632523309 2023-03-01 2276.038407396464 2023-04-01 2411.430325137532 2023-05-01 2553.683794644908 2023-06-01 2703.2758166475255 2023-07-01 2860.717791536936 2023-08-01 3026.55369930568 2023-09-01 3201.358264945518 2023-10-01 3385.744154196422 2023-11-01 3580.3611909160597 2023-12-01 3785.9074088159226 2024-01-01 4003.1237139142116 2024-02-01 4232.803338567126 2024-03-01 4475.7974057550805 ```
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值