This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class Exercise1 { | |
| public static void main(String[] args) { | |
| java.util.Scanner input = new java.util.Scanner(System.in); | |
| System.out.print("Enter employee name: "); | |
| String employeeName = input.nextLine(); | |
| System.out.println("Number of hours worked: "); | |
| int numberOfHoursWorked = input.nextInt(); | |
| System.out.println("Hourly wage rate: "); | |
| double wageRate = input.nextDouble(); | |
| System.out.println("Enter the Federal tax rate: "); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // A program for command line calculator. | |
| public class Calculator { | |
| public static void main(String[] args) { | |
| if (args.length != 1) { | |
| System.out.println("Incorrect input... there must be single space between operands."); | |
| System.exit(1); | |
| } | |
| // The result of the operation. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class CheckPalindrome { | |
| public static void main(String[] args) { | |
| java.util.Scanner input = new java.util.Scanner(System.in); | |
| System.out.println("Please enter the string: " ); | |
| String s = input.nextLine(); | |
| if (isPalindrome(s)) { | |
| System.out.print( s + " is a palindrome."); | |
| } | |
| else { | |
| System.out.print(s + " is not a palindrome."); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class CountEachLetter { | |
| public static void main(String[] args) { | |
| java.util.Scanner input = new java.util.Scanner(System.in); | |
| System.out.println("Please enter the string: "); | |
| String s = input.nextLine(); | |
| // Invoke the countLetters method to count each letter | |
| int[] counts = countLetters(s.toLowerCase()); | |
| //Display results | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import java.util.Scanner; | |
| public class Exercise9_1 { | |
| public static void main(String[] args) { | |
| System.out.println("Please enter your SSN: "); | |
| Scanner input = new Scanner(System.in); | |
| String s = input.nextLine(); | |
| if (s.matches("\\d{3}-\\d{2}-\\d{4}")) { | |
| System.out.println("The SSN entered by you is correct."); | |
| } | |
| else { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import java.util.Scanner; | |
| public class Exercise9_2 { | |
| public static void main(String[] args) { | |
| @SuppressWarnings("resource") | |
| Scanner input = new Scanner(System.in); | |
| System.out.println("Please enter the first string: "); | |
| String s1 = input.nextLine(); | |
| System.out.println("Please enter the second string: "); | |
| String s2 = input.nextLine(); | |
| if (s1.indexOf(s2) != -1) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import java.util.Scanner; | |
| public class Exercise9_3 { | |
| public static void main(String[] args) { | |
| Scanner input = new Scanner(System.in); | |
| System.out.println("Please enter the password: "); | |
| String password = input.nextLine(); | |
| if (isValid(password)) { | |
| System.out.println("The password is valid."); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import java.util.Scanner; | |
| public class Exercise9_4 { | |
| public static void main(String[] args) { | |
| Scanner input = new Scanner(System.in); | |
| System.out.println("Please enter a string: "); | |
| String s1 = input.nextLine(); | |
| System.out.println("Please enter a character: "); | |
| char s2 = input.nextLine().charAt(0); | |
| int counts = counts(s1, s2); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class Exercise9_5 { | |
| public static void main(String[] args) { | |
| java.util.Scanner input = new java.util.Scanner(System.in); | |
| System.out.println("Please enter a string: "); | |
| String s1 = input.nextLine(); | |
| int [] counts = countDigits(s1); | |
| // Display results. | |
| for (int i = 0; i < counts.length; i++) { | |
| if (counts [i] > 0) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // A phone keypad | |
| public class Exercise9_7 { | |
| public static void main(String[] args) { | |
| java.util.Scanner input = new java.util.Scanner(System.in); | |
| System.out.println("Please enter the string: "); | |
| String s1 = input.nextLine(); | |
| if (isValid(s1)) { | |
| System.out.println("The number is valid."); | |
| String s2 = s1.toLowerCase(); | 
OlderNewer