Help us understand the problem. What is going on with this article?

情報基礎2 第3回

ex03-1.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>今日の天気</title>
  </head>
  <body>
    <input type="button" value="ボタン" onclick="tenki()">
    <script type="text/javascript">
    function tenki(){
      var name = prompt("今日の天気は?");

      if (name=="晴れ"){
        alert("素敵な1日を");
      }else {
        alert("今日も頑張りましょう");
      }
    }
    </script>
  </body>
</html>
ex03-2.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>占い</title>
  </head>
  <body>
    <input type="button" value="ボタン" onclick="uranai()">
    <script type="text/javascript">
      function uranai() {
        var num = Math.random();

        if (num < 0.1) {
          alert("");
        } else if (0.1 <= num < 0.33) {
          alert("小吉");
        } else if (0.33 <= num < 0.66) {
          alert("中吉");
        } else if (0.66 < num) {
          alert("大吉");
        }
      }
    </script>
  </body>
</html>
ex03-3.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>夕食</title>
  </head>
  <body>
    <input type="button" value="if-elseボタン" onclick="dinner()">
    <input type="button" value="switch-caseボタン" onclick="dinner2()">
    <script type="text/javascript">
      function dinner(){
      var name = prompt("今日の夕飯の気分を 洋食/和食/中華/その他 で答えてください");

        if (name=="洋食"){
        alert("サイゼリヤがお勧め");
      }else if (name=="和食"){
        alert("大戸屋がお勧め");
      }else if (name=="中華"){
        alert("餃子の王将がお勧め");
        }else {
        alert("マックがお勧め");
        }
      }

      function dinner2(){
      var word = prompt("洋食/和食/中華/その他のいずれかを入力してください。");
      switch (word) {
        case "洋食":
        alert("サイゼリヤがお勧め");
        break;

        case "和食":
        alert("大戸屋がお勧め");
        break;

        case "中華":
        alert("餃子の王将がお勧め");
        break;

        case "その他":
        alert("マックがお勧め");
        break;

        default:
        alert("理解できません。");
      }
    }
    </script>
  </body>
</html>
ex03-4.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>夕食</title>
  </head>
  <body>
    <input type="button" value="ボタン" onclick="day()">
    <script type="text/javascript">
      function day(){
      var name = prompt("曜日は?");

        if (name=="月曜"){
          var jigen =prompt("時限は?")
          if (jigen=="4"){
            alert("情報基礎2");
          }else if (jigen=="5"){
            alert("情報基礎2");
          }else{
            alert("何も履修していません");
          }
        }

        if (name=="火曜"){
          var jigen =prompt("時限は?")
          if (jigen=="2"){
            alert("地域と社会");
          }else if (jigen=="3"){
            alert("政策立案論");
          }else if (jigen=="4"){
            alert("21世紀の企業の挑戦");
          }else if (jigen=="5"){
            alert("ライティング技法ワークショップ");
          }else{
            alert("何も履修していません");
          }
        }

        if (name=="水曜"){
          var jigen =prompt("時限は?")
          if (jigen=="1"){
            alert("何も履修していません");
          }else if (jigen=="2"){
            alert("何も履修していません");
          }else if (jigen=="3"){
            alert("何も履修していません");
          }else if (jigen=="4"){
            alert("何も履修していません");
          }else{
            alert("何も履修していません");
          }
        }

        if (name=="木曜"){
          var jigen =prompt("時限は?")
          if (jigen=="2"){
            alert("データ・ドリブン");
          }else if (jigen=="3"){
            alert("統計基礎");
          }else{
            alert("何も履修していません");
          }
        }

        if (name=="金曜"){
          var jigen =prompt("時限は?")
          if (jigen=="1"){
            alert("英語");
          }else if (jigen=="2"){
            alert("体育");
          }else if (jigen=="3"){
            alert("英語");
          }else{
            alert("何も履修していません");
          }
        }
      }
    </script>
  </body>
</html>
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした