HIS IS MEANT TO BE IN JAVA So far we've learned variables, branches, loops, and some array. The assignment is: 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: 1 n Ex: If the input is: z Today is Monday the output is: 0 z's Ex: If the input is: n It's a sunny day
THIS IS MEANT TO BE IN JAVA
So far we've learned variables, branches, loops, and some array. The assignment is:
Write a
Ex: If the input is:
n Monday
the output is:
1 n
Ex: If the input is:
z Today is Monday
the output is:
0 z's
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:
0 n's
n is different than N.
Please show the end result and why you added what you added. This is what I have so far:
import java.util.Scanner;
public class LabProgram {
public static void main(String[] args) {
}
}
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 4 images