reganwade6965 reganwade6965
  • 19-04-2018
  • Computers and Technology
contestada

Write a method that determines the total number of chars in each string of an array.

Respuesta :

penyou
penyou penyou
  • 20-04-2018
The total number of chars in each string is basically the size of each string.

Using JAVA:

        String[] arr = {"hello", "my", "name", "is", "Felicia"};                int count = 0;        for(int i = 0; i < arr.length; i++) {            count = count + arr[i].length();            System.out.println("Characters in " + arr[i] + ": " + count);        }

Output: 
Characters in hello: 5
Characters in my: 7
Characters in name: 11
Characters in is: 13
Characters in Felicia: 20



Answer Link

Otras preguntas

A student wrotw a variable expression n-5 for the word phrase n less than 5. explain the students error
need help will be more
what is an equation of the line that is perpendicular to y-3=-4(x+2) and passes through the point (-5,7)
Please help me!!!!!!!!!!
at the beginning of the Revolution, most Americans were
What is one reason that Thomas Paine brings up the opposing argument that the colonies have done well under British control? A. To create an opportunity to disp
What group was primarily responsible for taking care of the people's spirituality on the manor
Is MRSA a eukaryotic or prokaryotic structure?
According to ray rist's research, how long did it take for teachers to determine a child's potential success in school?
1. The Incident Command System (ICS) is only applicable to large, complex incidents. A. TRUE B. FALSE