@@ -0,0 +1,639 @@
+import java.util.*;%0Apublic class P5Q1 %7B%0A    public static void main(String%5B%5D args) %7B%0A        System.out.print(%22Enter a word: %22);%0A        Scanner scn = new Scanner(System.in);%0A        String word = scn.nextLine();%0A        System.out.print(%22Enter the letter you want to count: %22);%0A        String ch = scn.nextLine();%0A        System.out.format(%22'%25s' contains %25d %25c%5Cn%22, word, countLetter(word, ch.charAt(0)), ch.charAt(0));%0A    %7D%0A    public static int countLetter(String str, char ch) %7B%0A        int count = 0;%0A        for(int i = 0; i %3C str.length(); i++) %7B%0A            if(str.charAt(i) == ch) count++;%0A        %7D%0A        return count;%0A    %7D%0A%7D%0A

Create P5Q1.java