Question: Java Write a static method named containDigit that accepts two integer parameters a, and b. Assume that a is a positive integer (> 0) and

Java

Java Write a static method named containDigit that accepts two integer parameters

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 theta-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. Write a class called Lab13 with main method, in which create two integer variables: one is a random number in the range of [100000, 999999], 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!