<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>関数課題</title>
</head>
<body>
<script>
// 税抜き価格を定義
var price = window.prompt('<p>税抜き価格を入力してください<p>');
// 関数including_taxを実行する
function including_tax(price) {
price = price * 1.08;
price = Math.floor(price);
document.write('税込み価格は' + price + 'です');
}
// 税込み価格を計算する関数including_taxを作成する
including_tax(price);
</script>
</body>
</html>
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme