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]
2 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]2 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
__ are designed to be used with everyday objects, such as home appliances, gaming consoles, digital cameras, e-readers, digital
LenaWriter [7]

Answer:

Embedded Operating System

Explanation:

An embedded operating system is a specialized operating system dedicated to perform a unique task for a digital device other than your desktop or laptop. For example, we can find this operating system appears in a washing machine to enable user to control the operation of the washing machine. This type of operating system is designed to be more resource efficient. An embedded operating system can also found in cars, digital television, ATM machine, digital camera etc.

3 0
2 years ago
Consider an error-free 64 kbps satellite channel used to send 512 byte data frames in one direction, with very short acknowledge
Vladimir [108]

Answer:

The answer is "2".

Explanation:

In the given question some information is missing, that is "The propagation time for satellite to earth" which is "270 milliseconds" so, the description to this question can be defined as follows:

Given values:

Bandwidth = 64 kbps

Data frames = 512 bytes  

Propagation Time (t​​​​​​p ) =270 ms

Change Bandwidth  kbps to bps:

1 kb= 1024 bytes

calculated bandwidth= 64 kbps = 64×1024 bps = 65536 bps

1 bytes = 8 bits

512 bytes = 512 × 8 =  4096 bits

Frame length = 4096 bits

Formula

Transmission time (T​​​​​​t) = Frame length /Bandwidth

Window size = 1+2a

where a = Propagation time/Transmission time

Calculate Transmission time:

Transmission time (T​​​​​​t) = 4096 / 65536

Transmission time (T​​​​​​t)= 625 m.sec

Calculate Window size:

Window size = 1+2(270/625)

Window size = 1+2(0.432)

Window size = 1+0.864

Window size = 1.864

Window size = 2

3 0
2 years ago
How do i make a PDF and what is a PDF<br><br> sorry i am dumb
Soloha48 [4]

Answer:

............................................

Explanation:

5 0
2 years ago
Which function of a web page relies on responsive web design
navik [9.2K]

Answer:

Adding extra horizontal scroll, Blocking mobile devices from viewing, Eliminating extra links, Resizing content to fit a screen.

Explanation:

3 0
2 years ago
Wat kind o mouse pleese hep meh​
Trava [24]

Answer:

It's is a razer Basilisk

4 0
3 years ago
Other questions:
  • The LList class is (mostly) the same one discussed in lecture, but you must write a sort() function that uses one of the three i
    8·1 answer
  • Which of the following statements expresses why the following code is considered bad form? for (rate = 5; years-- &gt; 0; System
    9·2 answers
  • Click on the _____ tab on the ribbon to open the backstage view.
    7·1 answer
  • PLEASE HELP I FAILED TWICE AND HAVE ONLY ONE MORE TRY BEFORE MY GRADE ARE SET I AM CRYINGGGGG PLEASEEE IM BEGGINGGGGG
    10·1 answer
  • Select all the sets that are countably infinite. Question 3 options: the set of real numbers between 0.1 and 0.2 the set of all
    12·1 answer
  • What is the output?<br> &gt;&gt;&gt; password = "sdf#_356"<br> &gt;&gt;&gt; password.isalnum()
    8·2 answers
  • A _______________ is a particular type of network that uses circuits that run over the Internet but that appears to the user to
    10·1 answer
  • Which of the following is true about stateless applications?
    9·1 answer
  • Help me with this two questions please
    15·1 answer
  • Below functions flatten the nested list of integers (List[List[int]]) into a single list and remove duplicates by leaving only t
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!