当前位置:网站首页>JS uses the while cycle to calculate how many years it will take to grow from 1000 yuan to 5000 yuan if the interest rate for many years of investment is 5%
JS uses the while cycle to calculate how many years it will take to grow from 1000 yuan to 5000 yuan if the interest rate for many years of investment is 5%
2022-06-27 07:35:00 【I am the sun?】
The code is as follows :
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title> If the interest rate for many years of investment is 5%, Try to follow 1000 The block grows to 5000 block , How many years will it take </title>
<script type="text/javascript">
var money = 1000;
var year = 0;
while(money <= 5000){
money = money +(money*0.05);
year++;
console.log(" The first " + year + " year , Yes " + money + " element "+"<br />");
}
</script>
</head>
<body>
</body>
</html>
The operation results are as follows :
Or it could be :
Code :
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title> If the interest rate for many years of investment is 5%, Try to follow 1000 The block grows to 5000 block , How many years will it take </title>
<script type="text/javascript">
var money = 1000;
var year = 0;
while(money <= 5000){
money = money +(money*0.05);
year++;
}
console.log(" The first " + year + " year , Yes " + money + " element "+"<br />");
</script>
</head>
<body>
</body>
</html>
Running results :
边栏推荐
- JDBC参数化查询示例
- 【Kevin三连弹之三】Rust真的比C慢吗?进一步分析queen微测评
- 1-4 decimal representation and conversion
- 将通讯录功能设置为数据库维护,增加用户名和密码
- Configuring FTP, enterprise official website, database and other methods for ECS
- Interviewer: how to never migrate data and avoid hot issues by using sub database and sub table?
- js来打印1-100间的质数并求总个数优化版
- From 5 seconds to 1 second, the system flies
- What is the difference between volatile and synchronized?
- One person manages 1000 servers? This automatic operation and maintenance tool must be mastered
猜你喜欢

【Kevin三连弹之三】Rust真的比C慢吗?进一步分析queen微测评

How to download opencv? How to configure opencv after downloading?

Cookie加密6

Common operation and Principle Exploration of stream

js中输入三个值,并且由小到大输出

(resolved) NPM suddenly reports an error cannot find module 'd:\program files\nodejs\node_ modules\npm\bin\npm-cli. js‘

VNC Viewer方式的远程连接树莓派

Cookie encryption 7 fidder analysis phase

(已解决) MINet 进行测试时报错如下 raise NotImplementedError
![[Software Engineering] software engineering review outline of Shandong University](/img/38/2c783df56b50dee3bbb908f6f3e70e.png)
[Software Engineering] software engineering review outline of Shandong University
随机推荐
Interviewer: you use Lombok every day. What is its principle? I can't answer
将通讯录功能设置为数据库维护,增加用户名和密码
js中判断成绩是否合格,范围在0-100,否则重新输入
guava 教程收集一些案例慢慢写 google工具类
基础知识 | js基础
oracle的similarity方法实现原理
(已解决) npm突然报错 Cannot find module ‘D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js‘
在线文本数字识别列表求和工具
Mobile security tools -jad
volatile 和 synchronized 到底啥区别?
Solve the problem of win10 wsl2 IP change
js用switch语句根据1-7输出对应英文星期几
js中如何查看程序运行时间(计时器)
SQL考勤查询间隔一小时
Bean拷贝详解
Gérer 1000 serveurs par personne? Cet outil d'automatisation o & M doit être maîtrisé
延时队列`DelayQueue`
pytorch Default process group is not initialized
guava 定时任务
mysql关于自增和不能为空