Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please write a program that compiles and execute that has the exactly the same o

ID: 3632466 • Letter: P

Question

Please write a program that compiles and execute that has the exactly the same output of the program given below but using scanner instead of using the jpb package SimpleIO

here is the website for the jpb simpleio package: knking.com/books/java/jpb/index.html


// Checks a number for repeated digits

import jpb.*;

public class RepeatedDigits {
public static void main(String[] args) {
// Prompt user to enter a number and convert to int form
SimpleIO.prompt("Enter a number: ");
String userInput = SimpleIO.readLine().trim();
int number = Integer.parseInt(userInput);
while(number>0) //do until sentinel entered
{
// Create an array to store digit counts
int[] digitCounts = new int[10];

// Remove digits from the number, one by one, and
// increment the corresponding array element
while (number > 0) {
digitCounts[number%10]++;
number /= 10;
}

// Create a string containing all repeated digits
String repeatedDigits = "";
for (int i = 0; i < digitCounts.length; i++)
if (digitCounts[i] > 1)
repeatedDigits += i + " ";

// Display repeated digits. If no digits are repeated,
// display "No repeated digits".
if (repeatedDigits.length() > 0)
System.out.println("Repeated digits: " +
repeatedDigits);
else
System.out.println("No repeated digits");

SimpleIO.prompt("Enter a number: ");
userInput = SimpleIO.readLine().trim(); //get next number
number = Integer.parseInt(userInput);


}
}
}

Explanation / Answer

yeah delete this ..since u got answer but give me points please.....