0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Java script初心者が書いた為替計算の処理の計算についてまとめてみた

Posted at

【Javascript初心者が為替計算に挑戦してみた】

はじめに

普段はネットワークエンジニア関連の勉強をしていますが今回は為替計算をする機会があったのでそっちの話をしたいと思います

やったこと

・1ドル=150円として円をドルに換算する処理を考えました。
・両替は最大66ドルまでとしそれを超えた分はお釣りとして扱うようにしました。
・If文だけを使ったシンプルな処理を組むようにしました。

実際組んだコード

int dollar = yen / 150;
if (dollar > 66) {
dollar = 66;
}

    System.out.println(dollar);
    System.out.println(yen - dollar * 150);
}

}

めちゃくちゃ省略しましたがこんな感じでやりました。

学んだこと

・やっぱり実際に手を動かすのが一番理解できるなと再確認しました。

・「こうしたら動くかな?」と試行錯誤することで理解が深まった気がします。

おわりに

小さなコードでも完成させると自信につながります。これからも自分のペースで学んだことをまとめていきたいです!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?