我正在尝试从这段代码中将我的总数加在一起,但不知道该怎么做。这是我一直在研究的脚本,他们每天赚的钱都会翻倍。
<script>
// asks for the days you worked
var daysworked = parseFloat(prompt("daysworked", "100"));
//equation and table for the days worked
for (var days = 1; days <= daysworked; days++) {
document.write("<tr><td>"+ days +"</td>");
// here is specifically the equation and how i output it
document.write("<td>" + "$" + ( Math.pow(2 , days - 1)*0.01) +"</td></tr>");
我应该如何计算赚取的总金额?
DIEA
相关分类