Question: Hello, please give me the code for this assignment in JAVASCRIPT as well as one HTML page to display it, thank you. Assignment (Boolean Secret
Hello, please give me the code for this assignment in JAVASCRIPT as well as one HTML page to display it, thank you.
Assignment (Boolean Secret Message)
Our pirates are attempting to send a secret message between two ships by writing an encrypted message on their flags. Given two pre-made methods (parseAscii, and parseBin) Prompt the user for a single character, convert the character to ascii using the given parseAscii function, then convert the ascii into an 8-digit binary number using the parseBin function. Store each of the individual 1's and 0's of the binary number into an array using the split method. Finally, loop through the array and for every element write "true" to the page if 1 and write "false" to the page if 0. Here is a sample filewith the given functions we have made for you. The reading pages above contain lots of helpful hints for completing this assignment.
Prompt the user for a single character.
Loop until valid data is entered.
Use parseAscii() to assign the ascii value of that character to a variable with the int prefix.
Use parseBin() to convert the ascii value to a binary value. Store the result in another variable.
Store each of the individual 1's and 0's of the binary value into an array using the split() method.
Loop through the array of binary digits, and output "true" for each 1 and "false" for each 0 to an element on your page.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
