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
crimeas [40]
3 years ago
7

8. Given the array String[] words, which already contains 1 or more values, write a block of code which counts and returns the n

umber of words which start with the letter k
Computers and Technology
1 answer:
Vikentia [17]3 years ago
7 0

Answer:

Following are the code to this question:

public class Main//defining a class

{

public static void main(String[] arg)//defining main method

{

  String[] words={"Key","day", "Know", "kind"};//defining array of String words

  int x=0;//defining integer variable for count value

  for(int i=0;i<words.length;i++)//defining for loop for count value

  {

 if(words[i].startsWith("k")||words[i].startsWith("K"))//use if block to check word start from k

  x=x+1;//increment the value of x

  }

System.out.print("The number of letters which starts from k is: "+ x);//print value with message

}

}

Output:

The number of letters which starts from k is: 3

Explanation:

In this code, inside the main method an array of String "words" is defined that hold a value, and in the next step an integer variable "x" is defined, which is used to count the letters, which starts from k.

For this, a for loop is used that counts the value and in this an, if block is defined that uses the "startsWith" method to check the value and increment the value of x and at the last, it prints its value.

You might be interested in
Is the very calculation that we wish to avoid. Obtain a second equation by multiplying both sides of this equation by 1.06, then
Over [174]

Answer:

The answer is given in the attachment

Explanation:

3 0
3 years ago
At a murder scene, you have started making an image of a computer’s drive. You’re in the back bedroom of the house, and a small
GrogVix [38]

To preserve data, If you've previously emptied the RAM and registry, you may simply disconnect the power from the rear of the PC and remove the drive from the case; otherwise, if you want to save the entire system, you can carry the entire case with you.

<h3>What is a hard disk?</h3>

A hard disk drive or hard drive is a storage device that store data in an electronic device.

Thus, to preserve data, If you've previously emptied the RAM and registry, you may simply disconnect the power from the rear of the PC and remove the drive from the case; otherwise, if you want to save the entire system, you can carry the entire case with you.

Learn more about hard disk

brainly.com/question/14504942

#SPJ1

6 0
2 years ago
A personal business letter may be written by ?
disa [49]

Answer:

a college student inquiring about a loan.

Explanation:

6 0
3 years ago
Can we opne a website form PowerPoint slide ​
Phoenix [80]

Answer:

Yes

Explanation:

Type in the link, play the presentation and click the link. Or hover over the link and press ctrl + click at the same time. (Don't know if I got the last part right)

3 0
4 years ago
Read 2 more answers
Describe how the process of sampling, RGB pixels, and binary sequences work together to display a digital color image. Plz I got
iragen [17]

Answer:

Sampling, RBG pixels and binary sequences work together to display a digital color image by letting the computer know where the RBG pixel is going to be placed and what the opacity for that pixel is. The combination of these components is what gives you a digital color image.

Explanation:

I'm not sure if this is correct because I had trouble with it too but this is what I wrote for the answer.

4 0
3 years ago
Other questions:
  • C2.5 - A group of four pirates has a treasure chest and one unique lock and key for each pirate. Using hardware that is probably
    6·1 answer
  • On five lane roadways, the center lane is designated for __________ and is used by vehicles traveling in both directions.
    14·1 answer
  • Arcade games such as Donkey Kong, Mr. Dol, and Venture were adapted from arcade titles to home consoles by which company?
    9·2 answers
  • Which feature of a blog marks a unique link to each post through which it can be recalled anytime?
    8·2 answers
  • Andrew will use the _____ picture option to add a new image. ??
    15·2 answers
  • List the memory units inside and outside of the CPU, along with short descriptions of their
    11·1 answer
  • One of the prominent movies released in the 1950s is
    15·2 answers
  • Differences of a desktop computer and a laptop
    13·1 answer
  • What are some characteristics of pseudocode? Check all that apply. Pseudocode is an informal way of expressing ideas and algorit
    11·2 answers
  • Which web design concept is most closely related to elements that symbolize the real world​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!