subject

•write a static method named containdigit that accepts two integer parameters a, and b.– assume that a is a positive integer (> 0) and b is single-digit numbers from 0-9 inclusive.– your method should return; • true if a contains b at among its digits, and• false otherwise.– for example containdigit (3415, 1) should return true.– note: you can not use a string to solve this problem.• write a class called lab13 with main method, in which– create two integer variables: • one is a random number in the range of [1000,],• the other one is a single digit reading from the console (using scanner); – call method containdigit with above two variables; – print out your name, the two numbers like: • my name is "…", and 2345 contains 7: false– note: to check all digits in the number, you should use while or do-while loop. write a method called showtwos that shows the factors of 2 in a given random integer in the range of [16,128] (by using of while loop). for example, consider the following calls: showtwos(7); showtwos(18); showtwos(68); showtwos(120); these calls should produce the following output: 7 = 718 = 2 * 968 = 2 * 2 * 17120 = 2 * 2 * 2 * 15question(friday): • write a static method named containdigit that accepts two integer parameters a, and b.• assume that a is a positive integer (> 0) and b is single-digit numbers from 0-9 inclusive.• your method should return; • true if a contains b at among its digits, and• false otherwise.• for example containdigit (421235, 1) should return true.• note: you can not use a string to solve this problem.• write a class called lab13 with main method, in which• create two integer variables: • one is a random number in the range of [1,],• the other one is a single digit reading from the console (using scanner); • call method containdigit with above two variables; • print out your name, the two numbers like: • my name is "…", and 234553 contains 6: false• note: to check all digits in the number, you should use while or do-while loop. write a method called gcd that accepts two random integers in the range of [32,256] as parameters and returns the greatest common divisor (gcd) of the two numbers (by using of while loop).the gcd of two integers a and b is the largest integer that is a factor of both a and b. one efficient way to compute the gcd of two numbers is to use euclid’s algorithm, which states the following: gcd (a, b) _ gcd (b, a % b)gcd (a, 0) _absolute value of a

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. a company wants to use online methods to target more customers. it decides to conduct a market research by collecting the data of a few customers with their consent. they want to track data of the sites that their customers frequently visit. which software can the company? a. spyware b. bots c. adware d. trojan horse e. rootkits
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Apart from confidential information, what other information does nda to outline? ndas not only outline confidential information, but they also enable you to outline .
Answers: 1
question
Computers and Technology, 24.06.2019 15:40
In the above figure, what type of cylinder arrangement is shown in the figure above? a. l-type b. v-type c. in-line d. horizontal pls make sure its right if its rong im grounded for 3months
Answers: 1
question
Computers and Technology, 25.06.2019 07:00
Afile named data.txt contains an unknown number of lines, each consisting of a single integer. write some code that creates two files, dataplus.txt and dataminus.txt, and copies all the lines of data1.txt that have positive integers to dataplus.txt, and all the lines of data1.txt that have negative integers to dataminus.txt. zeros are not copied anywhere.
Answers: 2
You know the right answer?
•write a static method named containdigit that accepts two integer parameters a, and b.– assume that...
Questions