Java Programming

27
Views
0
Answers
Very Basic Choose Your Own Adventure Source Code Java
Write your code in the "script.js" file in repl.it. (Make sure your HTML loads it!) Write your code in the JavaScript section. Create a JavaScript program that meets the requirements. To submit your project, choose “Share”, copy the lin...
\r\n \r\nIt assumes that your Javascript is in another file named \"script.js\"\r\n \r\nThen, go to your script.js file and put in the following:\r\n \r\nfunction test() {\r\n var input = prompt(\"Enter a test string.\");\r\n alert(input);\r\n}\r\ntest();\r\nIt should do a basic input/output program. For your structure, you can simply do nested if statements like this:\r\nvar input1 = prompt(\"Do you want to go left or right?\");\r\nif (input1 == \"left\") {\r\n var input2 = prompt(\"What about up or down?\");\r\n if (input2 == \"up\") {\r\n //go up...\r\n }\r\n else {\r\n //go down...\r\n }\r\n}\r\nelse if (input1 == \"right\") {\r\n //and so on...\r\n}\r\nYour JavaScript game should include:\r\n\r\nPrompts and variables to let your user make choices (at least 3) \r\nSwitches (such as case statements or if/else statements) and logical operators (such as <, >, =, !) to provide consequences (at least 2 steps per choice) - this will result in at least 6 unique endings, usually more.\r\nInclude outcomes for all possibilities, including user error (input validation) \r\nFormat your responses so that each answer appears on a new line \r\nRemember to comment your code so that it is easy to follow","requirements":null,"price":35,"created_at":"2021-01-08T08:54:47.000000Z","updated_at":"2021-01-08T08:54:47.000000Z","user_id":13569,"status":"Bidding","type_id":26,"user_type":null,"subject_id":13,"user_subject":null,"question_id":null,"notes":null,"priority":"normal","visibility":"public","featured":false,"market":"public","tutorial":false,"learn":true,"profile":"https://tutlance.com/learn/questions/very-basic-choose-your-own-adventure-source-code-java-88","abilities":[],"formatted_price":"$35.00","proposals_count":0,"answers_count":0,"attachment_route":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/attachment","views_count":27,"disputed":false,"links":{"answers":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/answers","sell":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/answers","propose":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/proposals","proposals":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/proposals","agreement":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/signed","edit":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/edit","prioritize":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/prioritize","privatize":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/privatize","promote":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/promote","review":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/review","quote":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/quote","quotes":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/quotes","answer":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/answer-url","profile":"https://tutlance.com/home/orders/very-basic-choose-your-own-adventure-source-code-java-88","order_show":"https://tutlance.com/question/very-basic-choose-your-own-adventure-source-code-java-88","upload":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/attachments","delete":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88","disputes":"https://tutlance.com/api/questions/v1/very-basic-choose-your-own-adventure-source-code-java-88/disputes","dispute":"https://tutlance.com/api/questions/v1/very-basic-choose-your-own-adventure-source-code-java-88/disputes","learn":"https://tutlance.com/learn/questions/very-basic-choose-your-own-adventure-source-code-java-88","upgrades":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/upgrades","checkout":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/checkout","checkables":"https://tutlance.com/questions/very-basic-choose-your-own-adventure-source-code-java-88/checkables","uploads_api":"https://tutlance.com/api/questions/v1/very-basic-choose-your-own-adventure-source-code-java-88/uploads","expertise_answers":"https://tutlance.com/learn/answers/very-basic-choose-your-own-adventure-source-code-java-88"},"answered":false,"summary":"Write your code in the \"script.js\" file in repl.it. (Make sure your HTML loads it!)\r\n\r\nWrite your code in the JavaScript section.\r\n\r\nCreate a JavaScript program that meets the requirements. \r\n\r\nTo submit your project, choose “Share”, copy the lin...","user":{"data":{"id":13569,"name":"Matthew Dos Reis","slug":"matthew-dos-reis","education":null,"photo":null,"created_at":"2021-01-08T08:52:07.000000Z","updated_at":"2021-01-08T08:52:50.000000Z","timezone":null,"bio":null,"username":"Zooted026","expert":0,"status":"new","type":"student","deleted_at":null,"level":"standard","email_verified_at":"2021-01-08 08:52:50","profile":"/account","is_tutor":false,"is_student":true,"is_admin":false,"payment_notifications":0,"support_notifications":0,"question_notifications":0,"pic":"https://secure.gravatar.com/avatar/84707e117025bd4651371d4172cdca00?s=256&r=x&d=identicon","attachment_route":"https://tutlance.com/account/Zooted026/attachment","abilities":[],"answers_count":0,"rating":0,"is_verified":true,"links":{"questions":"https://tutlance.com/api/users/v1/Zooted026/questions","answers":"https://tutlance.com/users/Zooted026/answers","messages":"https://tutlance.com/users/Zooted026/messages","transactions":"https://tutlance.com/users/Zooted026/transactions","withdraw":"https://tutlance.com/withdrawals","withdrawals":"https://tutlance.com/withdrawals","support":"https://tutlance.com/support","ratings":"https://tutlance.com/users/Zooted026/ratings","state":"https://tutlance.com/admin/users/Zooted026","delete":"https://tutlance.com/admin/users/Zooted026","restore":"https://tutlance.com/admin/users/Zooted026","level_application":"https://tutlance.com/levels","levels":"https://tutlance.com/users/Zooted026/levels","paypal_consent":"https://tutlance.com/paypal/consent","samples":"https://tutlance.com/api/samples/v1/user/Zooted026","samples_list":"https://tutlance.com/users/Zooted026/samples","academics":"https://tutlance.com/users/Zooted026/academics","home":"https://tutlance.com/home","balance":"https://tutlance.com/account/Zooted026/balance","orders":"https://tutlance.com/home/orders","logout":"https://tutlance.com/logout","notifications":"https://tutlance.com/api/users/v1/notifications","dashboard_states_link":"https://tutlance.com/api/users/v1/questions-states","account_actions":"https://tutlance.com/api/users/v1/Zooted026/account-actions","profile":"https://tutlance.com/account/Zooted026"},"formatted_balance":"0.00","completed_profile":{"profile":false,"certificates":false,"blogs":true,"paypal":true},"is_active":true,"self":false,"order_stats":{"completed":0,"positive":0,"negative":0},"active_disputes":0,"action_reason":null,"disabled":false,"balance":null,"subjects":{"data":[]},"types":{"data":[]},"identity_documents":{"data":[]}}},"subject":{"data":[]},"type":{"data":[]},"uploads":{"data":[]},"tutor":{"data":[]}}],"meta":{"pagination":{"total":1,"count":1,"per_page":10,"current_page":1,"total_pages":1,"links":{}}}},"back":"https://tutlance.com"},"user_data":{"notifications":null},"grecaptcha":false,"charts":false,"route":{"path":"/learn/java-programming","hash":"","query":{},"params":{"subject":"java-programming"},"fullPath":"/learn/java-programming","meta":{},"from":{"name":null,"path":"/","hash":"","query":{},"params":{},"fullPath":"/","meta":{}}},"url":"/learn/java-programming"}