1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Olenka [21]
3 years ago
9

Implement the method countInitial which accepts as parameters an ArrayList of Strings and a letter, stored in a String. (Precond

ition: the String letter has only one character. You do not need to check for this.) The method should return the number of Strings in the input ArrayList that start with the given letter. Your implementation should ignore the case of the Strings in the ArrayList. Hint - the algorithm to implement this method is just a modified version of the linear search algorithm. Use the runner class to test your method but do not add a main method to your U7_L4_Activity_One.java file or your code will not be scored correctly.
Computers and Technology
1 answer:
Neko [114]3 years ago
6 0

Answer:

Answered below

Explanation:

//Program is implemented in Java

public int countInitials(ArrayList<string> words, char letter){

int count = 0;

int i;

for(i = 0; i < words.length; i++){

if ( words[i][0]) == letter){

count++

}

}

return count;

}

//Test class

Class Test{

public static void main (String args[]){

ArrayList<string> words = new ArrayList<string>()

words.add("boy");

words.add("bell");

words.add("cat");

char letter = 'y';

int numWords = countInitials ( words, letter);

System.out.print(numWords);

}

}

You might be interested in
What text results in variable whitespace?<br><br> [blank] text results in even whitespace.
alexdok [17]

Answer:

In almost all the windows applications that handle the text, like in Microsoft word, you can make use of the ASCII code for inserting the blank character or the non-breaking space. This can be done by pressing the Alt and then typing 255 from the numeric keypad, and finally releasing the ALT key. And please keep in mind that this will not work if you will be using the ordinary number key.

For even whitespace you need to use the spacebar and check the character count with whitespaces to be even.

Explanation:

Please check the answer section.

8 0
3 years ago
What does an IT worker do
djyliett [7]

Answer:

they get horney

Explanation:

lol

4 0
3 years ago
Your employer is opening a new location, and the IT director has assigned you the task of calculating the subnet numbers for the
astraxan [27]

Answer:

Check the explanation

Explanation:

• We are taking a look at the class B network beginning with 172.0.0.0.0,while Converting this value to binary as:10101100.00010100.00000000.00000000.  32 bits in total, out of this the First 16 bits that are used as network ID and the subsequent 16 bits are used as HostID.Out of the 16 bits that are sued for Network ID the 2 bits namely Bits fifteen and sixteen (15 and 16) have been set and can't be changed and hence only 14 bits are used as network ID.

• Now so that we can divide this network into 50 subnets for class B network we will have to borrow a bit as shown below:

• 10101100.00010100.00000000.00000000=172.0.0.0.0,Adding 1 bit by borrowing from host portion and adding it to network ID will give it 10101100.00010100.00000000.00000000(0 shown in bold) or10101100.00010100.10000000.00000000 (1 shown in bold) will give us 2 unique subnets.i.e changing 1 bit will give us 2 power 1=2 subnets,thus changing 2 bits will give us 2 power 2 subnets =4 similarly changing 6 bits will give us 64 unique subnets.

• Which means and going by the above problem statement in case we need 50 subnets and we also need to change 6 bits in the Network ID to give 50 unique subnets.

• Thus the answer is 6

3 0
4 years ago
On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance
sergey [27]

Answer:

The programming language is not stated; so, I'll solve this question using Java programming language

Comments are used for explanatory purpose

//Begin of Program

import java . util.*;

import java. math . RoundingMode;

import java . text . DecimalFormat;

public class keyfreq

{

private static DecimalFormat df = new DecimalFormat("0.00");

public static void main(String [] args)

{

 Scanner input = new Scanner(System.in);

 //Declare variable

 float f0;

//Prompt user for input

System.out.print("Enter Initial Key Frequency: ");

f0 = input.nextFloat();

//Initialize number of keys

int numkey = 1;

//Print first key frequency

System.out.print("Key Frequencies: " + df.format(f0)+" ");  

while(numkey<=4)

{

 //Calculate next frequency

 f0*= Math.pow(2,(1.0/12.0));

 //Print Frequency

 System.out.print(df.format(f0)+" ");  

  //Iterate to next frequency

 numkey++;

}

}

}

//End of Program

Explanation:

See Comments in the above program

See Attachment for source file

Download java
6 0
3 years ago
What is copy formatting​
liraira [26]

Answer:

Copy formatting lets you copy all the formatting from one object and apply it to another one, think of it as copying and pasting formatting.

6 0
3 years ago
Other questions:
  • To set up a slide show you should do all of the following except ______.
    9·1 answer
  • What is looping? the rerecording of sound first recorded on set the recording of sound on set the process of combining different
    11·1 answer
  • Which of the following would be an example of a loss of record integrity in a
    12·1 answer
  • List the memory units inside and outside of the CPU, along with short descriptions of their
    11·1 answer
  • The default ____ for a hyperlink is the folder location and the name of the file to which you will link.
    6·1 answer
  • You load an image file into a numpy array and look at its shape, which is (433, 650). What does this indicate?
    13·1 answer
  • Write multiple if statements: If carYear is before 1967, print "Probably has few safety features." (without quotes). If after 19
    11·1 answer
  • Answer this correct and get brainly
    5·2 answers
  • COMO DEFINES LAS PALABRAS COMPUTADOR Y DISPOSITIVO? MENCIONA EJEMPLOS
    13·1 answer
  • Select the correct answer.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!