4.17 LAB: Count characters Write a program whose input is a character and a string, and whose output indicates the numbe
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
4.17 LAB: Count characters Write a program whose input is a character and a string, and whose output indicates the numbe
4.17 LAB: Count characters Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in the string. The output should include the input character and use the plural form, n's, if the number of times the characters appears is not exactly 1. Ex: If the input is: n Monday the output is: Ex: If the input is: z Today is Monday the output is: Ex: If the input is: n It's a sunny day the output is: 2 n's Case matters. Ex: If the input is: n Nobody the output is: O n's n is different than N. 309766.2211294.7 LAB ACTIVITY 0/10 Load default template... 1 import java.util.Scanner; 2 3 public class LabProgram { 4 SAWNE 4.17.1: LAB: Count characters public static void main(String[] args) { /* Type your code here. */ LabProgram.java