{"id":26964195,"url":"https://github.com/jasheloper/conditionals-test-2","last_synced_at":"2025-04-03T06:30:09.246Z","repository":{"id":201104001,"uuid":"706455256","full_name":"jasheloper/conditionals-test-2","owner":"jasheloper","description":"Test skills with JavaScript conditionals.","archived":false,"fork":false,"pushed_at":"2023-10-24T01:07:45.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-10-24T02:31:23.620Z","etag":null,"topics":["conditionals","javascript"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasheloper.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-18T01:46:36.000Z","updated_at":"2023-10-24T01:17:59.000Z","dependencies_parsed_at":"2024-05-10T19:46:03.324Z","dependency_job_id":null,"html_url":"https://github.com/jasheloper/conditionals-test-2","commit_stats":null,"previous_names":["jasheloper/conditionals-test-2"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasheloper%2Fconditionals-test-2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasheloper%2Fconditionals-test-2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasheloper%2Fconditionals-test-2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasheloper%2Fconditionals-test-2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasheloper","download_url":"https://codeload.github.com/jasheloper/conditionals-test-2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246947623,"owners_count":20859286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conditionals","javascript"],"created_at":"2025-04-03T06:30:08.564Z","updated_at":"2025-04-03T06:30:09.135Z","avatar_url":"https://github.com/jasheloper.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## Exercise Link:\nhttps://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Test_your_skills:_Conditionals\n\n\n## Instructions:\nFor this task you are given three variables:\n\n- `machineActive` — contains an indicator of whether the answer machine is switched on or not (true/false)\n\n- `score` — Contains your score in an imaginary game. This score is fed into the answer machine, which provides a response to indicate how well you did.\n\n- `response` — begins uninitialized, but is later used to store a response that will be printed to the output panel.\n\n\u003cbr\u003e\n\nYou need to create an `if...else` structure that checks whether the machine is switched on and puts a message into the response variable if it isn't, telling the user to switch the machine on.\n\n\u003cbr\u003e\n\nInside the first `if...else`, you need to nest another `if...else` that puts appropriate messages into the response variable depending on what the value of score is — if the machine is turned on. The different conditional tests (and resulting responses) are as follows:\n\n\u003cbr\u003e\n\n- Score of less than 0 or more than 100 — \"This is not possible, an error has occurred.\"\n\n- Score of 0 to 19 — \"That was a terrible score — total fail!\"\n\n- Score of 20 to 39 — \"You know some things, but it\\'s a pretty bad score. Needs improvement.\"\n\n- Score of 40 to 69 — \"You did a passable job, not bad!\"\n\n- Score of 70 to 89 — \"That\\'s a great score, you really know your stuff.\"\n\n- Score of 90 to 100 — \"What an amazing score! Did you cheat? Are you for real?\"\n\n\u003cbr\u003e\n\nAfter you've entered your code, try changing `machineActive` to `true`, to see if it works.\n\n\n## My Solution\n\n```\n// Add your code here\n\n    let response;\n    let score = 100;\n    let machineActive = true;\n  \n    // Add your code here\n\n      if (machineActive) {\n        if (score \u003c 0 || score \u003e 100) {\n            response = \"This is not possible, an error has occurred.\"\n\n        } else if (score \u003e= 0 \u0026\u0026 score \u003c= 19) {\n            response = \"That was a terrible score — total fail!\"\n\n        } else if (score \u003e= 20 \u0026\u0026 score \u003c= 39) {\n            response = \"You know some things, but it\\'s a pretty bad score. Needs improvement.\"\n\n        } else if (score \u003e= 40 \u0026\u0026 score \u003c= 69) {\n            response = \"You did a passable job, not bad!\"\n\n        } else if (score \u003e= 70 \u0026\u0026 score \u003c= 89) {\n            response = \"That\\'s a great score, you really know your stuff.\"\n\n        } else if (score \u003e= 90 \u0026\u0026 score \u003c= 100) {\n            response = \"What an amazing score! Did you cheat? Are you for real?\"\n        }\n     } else {\n            response = \"Switch the machine to ON, to see a new message.\"\n     }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasheloper%2Fconditionals-test-2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasheloper%2Fconditionals-test-2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasheloper%2Fconditionals-test-2/lists"}