Q2) Write a method that counts the occurrences of each capital character in a string. The method counts how many times a character in the upper case appears in the string. The return value is an array...


Q2) Write a method that counts the occurrences of each capital character in a string. The<br>method counts how many times a character in the upper case appears in the string. The return<br>value is an array of elements, each of which holds the count for an upper character. Write a test<br>program that prompts the user to enter a string and displays the number of occurrences of each<br>upper character in the string.<br>Note: The header of the method is as follows:<br>public static int[] countUpperCharacter(String s)<br>Sample Input:<br>Please enter a string:<br>12203АВСаd3<br>Java<br>Sample Output:<br>A occurs 1<br>В оссurs 1<br>C occurs 1<br>

Extracted text: Q2) Write a method that counts the occurrences of each capital character in a string. The method counts how many times a character in the upper case appears in the string. The return value is an array of elements, each of which holds the count for an upper character. Write a test program that prompts the user to enter a string and displays the number of occurrences of each upper character in the string. Note: The header of the method is as follows: public static int[] countUpperCharacter(String s) Sample Input: Please enter a string: 12203АВСаd3 Java Sample Output: A occurs 1 В оссurs 1 C occurs 1

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here