Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj01 committed Apr 7, 2024
1 parent b49ae2a commit b5c1df1
Showing 1 changed file with 62 additions and 31 deletions.
93 changes: 62 additions & 31 deletions cpl/js/lmj.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,62 @@
let p2023Q4 = [
0.3,
0.05,
0.03,
0.15,
0.20,
0.12,
0.05,
0.05,
0.03,
0.02,
];
let r2023Q4 = [
90,
100,
100,
50,
0,
98,
100,
100,
100,
100,
]
const score = p2023Q4.reduce((pv,cv,i)=>{
const r1 = cv * r2023Q4[i];
const r2 = pv + r1;
console.log(r1, r2);
return r2;
}, 0)
console.log('total -- ', score);
const q1in2024 = {
p: [
0.20,
0.30,
0.15,
0.05,
0.10,
0.10,
0.05,
0.03,
0.02,
],
r: [
90,
80,
40, // 暂停
30, // 暂停
90,
100,
100,
100,
100,
],
}
const q4in2023 = {
p: [
0.3,
0.05,
0.03,
0.15,
0.20,
0.12,
0.05,
0.05,
0.03,
0.02,
],
r: [
90,
100,
100,
50,
0,
98,
100,
100,
100,
100,
],
}
const arrayList = [q1in2024, q4in2023];
function toScroe(data) {
console.log('one-quater-year')
return data.p.reduce((pv,cv,i)=>{
const r1 = cv * data.r[i];
const r2 = pv + r1;
console.log(i, r1, r2)
return r2;
}, 0)
}

console.log('total -- ', arrayList.map(e=>toScroe(e)));

0 comments on commit b5c1df1

Please sign in to comment.