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
balu736 [363]
2 years ago
5

The sameNumber method checks to see if the number of words in the phrase, numwords, is the same number of words contained in the

myWords array. The method returns true of the array and phrase have the same number of words and false if they do not. Write the sameNumber method.
Computers and Technology
1 answer:
Eduardwww [97]2 years ago
6 0

Answer:

Answered below.

Explanation:

//Program is written in Kotlin programming language.

fun sameNumber(numWords: String, myWords: List<String>) : Boolean{

//Split words in phrase into list

val str: List<String> = numWords.split(" ")

//Convert to mutable list.

val phrase = str.toMutableList()

val words = myWords.toMutableList()

//Compare the number of items in each list.

if( phrase.size == words.size){

return true

}else{

return false

}

}

You might be interested in
Suppose during a TCP connection between A and B, B acting as a TCP receiver, sometimes discards segments received out of sequenc
Shalnov [3]

Answer:

Yes

Explanation:

We known that TCP is the connection \text{oriented} protocol. So the TCP expects for the target host to acknowledge or to check that the \text{communication} session has been established or not.

Also the End stations that is running reliable protocols will be working together in order to verify transmission of data so as to ensure the accuracy and the integrity of the data. Hence it is reliable and so the data can be sent A will still be delivered reliably and it is in-sequence at B.

4 0
2 years ago
What would you consider before buying a printer​
Marysya12 [62]

Answer:

Printing Quality, Price, If it van vonnect to my laptop or nay devices.

4 0
1 year ago
Read 2 more answers
To assign the contents of one array to another, you must use ________.
iren [92.7K]

Answer:

Option c is the correct answer for the above question.

Explanation:

  • The array is used to holds multiple variables and the assignment operator can assign only a single variable at a time. So if a user wants to assign the whole array value into other array value then he needs to follow the loop.
  • The loop iteration moves on equal to the size of the array. It is because the array value moves into another array in one by one. It means the single value can move in a single time. So the moving processor from one array to another array takes n times if the first array size is n.
  • The above question asked about the processor to move the element from one array to another and the processor is a loop because the loop can execute a single statement into n times. So the C option is correct while the other is not because--
  1. Option 'a' states about one assignment operator which is used for the one value only.
  2. Option b states about the equality operator which is used to compare two values at a time.
  3. Option d states any of these but only option c is the correct answer.
  4. Option 'e' states none of these but option c is the correct.
8 0
2 years ago
Write a short quiz program which asks three true/false questions and stores the user's answers as booleans. At the end the progr
viva [34]

this answering question interface is bleh

8 0
3 years ago
What is the most important thing you should avoid when you store files and folders?
iVinArrow [24]
Getting hacked by someone
4 0
3 years ago
Other questions:
  • Which of the following statements are true about the Internet?
    14·1 answer
  • Universal Containers recently rolled out a Lightning Knowledge implementation; however, users are finding unreliable and unrelat
    6·1 answer
  • If you want to emphasize the Greek root of a word in a document, which tool in Microsoft® Word could you use?
    6·2 answers
  • after placing her insertion point after grandma's kitchen, order the steps Danica needs to follow to insert and format the regis
    12·2 answers
  • The ____ class act as a switchboard between the view layer and the domain layer.
    14·1 answer
  • Which of the following statements is true?A)Implicit data type conversion is performed when you mix values of different data typ
    5·1 answer
  • Which of these is an example of rebranding ?
    6·2 answers
  • Definition of powerpoint animation
    14·1 answer
  • How are most databases organized?
    15·1 answer
  • 1. The letters that appear after the dot after a file name are called the:
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!