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 06:30
On early television stations, what typically filled the screen from around 11pm until 6am? test dummies test patterns tests testing colors
Answers: 1
question
Computers and Technology, 24.06.2019 16:30
Pressing the backspace key deletes the text to the of the insertion point. the left or the right?
Answers: 1
question
Computers and Technology, 25.06.2019 02:00
Lisa is making a presentation for her project and she wants to use the logo of her company in her presentation. which element would she use to make her logo stand out in her presentation? a. gradation b. contrast c. alignment d. balance
Answers: 1
question
Computers and Technology, 25.06.2019 08:10
Is a philosophy and a software and system development methodology that focuses on the development, use, and reuse of small, self-contained blocks of codes to meet the software needs of an organization.joint application designextreme programmingrapid application developmentservice-oriented architecture
Answers: 1
You know the right answer?
•write a static method named containdigit that accepts two integer parameters a, and b.– assume that...
Questions
Questions on the website: 13722367