subject

You may have a combination lock on your locker at school where you have to spin the dial to 3 separate numbers from 0 up to 40. What if you forgot your combination? Would you be able to guess it?

Write code that will generate 3 random integers from 0 up to 40 (but not including 40) using Math. random() in the Active Code window below. Run it a couple times to see it generate different numbers.

How many times would you need to run it to guess your combination correctly? Let’s have the code compute the number of permutations possible in your combination lock using Math. pow(number, exponent). For example, if you had 2 dials on your combination lock where each dial can be set to a digit from 0-9 (10 digits), there are 102 possible permutations. In Java, this would be written as Math. pow(10,2) which means 10 to the power of 2. If you start listing all the permutations possible, you can tell that there are 102 or 100 possible permutations for a 2 dial lock from 0-9.

00, 01, 02, 03, 04, 05, 06, 07, 08, 09

10, 11, 12, 13, 14, 15, 16, 17, 18, 19

...

90, 91, 92, 93, 94, 95, 96, 97, 98, 99

Now what about the combination lock for this challenge? It has 3 dials with 0-40 (not including 40) numbers possible on each dial. In general, the formula to use is . Write this using the Math. pow() method in your code and save it into a variable and print out.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Which one of the following identifies the primary a purpose of information classification processes? a. define the requirements for protecting sensitive data.b. define the requirements for backing up data.c. define the requirements for storing data.d. define the requirements for transmitting data.
Answers: 2
question
Computers and Technology, 22.06.2019 03:10
This program reads a file called 'test.txt'. you are required to write two functions that build a wordlist out of all of the words found in the file and print all of the unique words found in the file. remove punctuations using 'string.punctuation' and 'strip()' before adding words to the wordlist. write a function build_wordlist() that takes a 'file pointer' as an argument and reads the contents, builds the wordlist after removing punctuations, and then returns the wordlist. another function find_unique() will take this wordlist as a parameter and return another wordlist comprising of all unique words found in the wordlist. example: contents of 'test.txt': test file another line in the test file output: ['another', 'file', 'in', 'line', 'test', 'the']
Answers: 1
question
Computers and Technology, 23.06.2019 09:20
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
question
Computers and Technology, 23.06.2019 10:00
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
You know the right answer?
You may have a combination lock on your locker at school where you have to spin the dial to 3 separa...
Questions
question
Physics, 02.11.2019 11:31
question
Spanish, 02.11.2019 11:31
question
Mathematics, 02.11.2019 11:31
question
History, 02.11.2019 11:31
Questions on the website: 13722360