Question: CHALLENGE ACTIVITY 2.13.1: String with digit. Set hasDigit to true if the 3-character passCode contains a digit. 1 import java.util.Scanner; 1 tes: passed All tests

CHALLENGE ACTIVITY 2.13.1: String with digit. Set hasDigit to true if the 3-character passCode contains a digit. 1 import java.util.Scanner; 1 tes: passed All tests passed 3 public class CheckingPasscodes { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); 6 boolean hasDigit; 7 String passCode; 8 9 hasDigit = false; 10 passCode = scnr.next(); 11 12 1* Your solution goes here */ 13 14 if (hasDigit) { 15 System.out.println("Has a digit."); 16 17 else { 18 System.out.println("Has no digit."); 19 } 20 } 21 } Run View your last submission Feedback
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
