answer.
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
pashok25
2 months ago
11

array of String objects, words, has been properly declared and initialized. Each element of words contains a String consisting o

f lowercase letters (a–z). Write a code segment that uses an enhanced for loop to print all elements of words that end with "ing". As an example, if words contains {"ten", "fading", "post", "card", "thunder", "hinge", "trailing", "batting"}, then the following output should be produced by the code segment.
Computers and Technology
1 answer:
oksian1 [950]2 months ago
5 0

Answer:

for(String s:words)

   if(s.endsWith("ing"))

 System.out.println(s);

Explanation:

Execute an enhanced for loop to go through the words array

Verify if any word in the array ends with "ing" using the endsWith() function (Given that strings are lowercase letters, no additional checks are necessary)

If a word ending with "ing" is found, print it.

You might be interested in
Dawn needs to insert a macro into a Word document. Where can she find the Insert Macro dialog box?
oksian1 [950]
The process of accessing the Macro dialog box may be puzzling for some since the "Developer tab," the section where it resides, is not displayed by default in Microsoft Word. To make it visible in the ribbon, one simply needs to navigate to the File tab, select Options, and then click on Customize Ribbon. Under this option, choose Main Tabs and tick the Developer checkbox. Once done, the Developer tab will appear, allowing you to insert a macro.
6 0
1 month ago
Need 2.5 Code Practice Answers
Natasha_Volkova [1026]

Answer:

import random

random.seed(1,10) # Note: seed takes one argument, so this line has an error

a = random.randint(1, 10)

b = random.randint(1, 10)

print("Calculate: " + str(a) + " X " + str(b) + "?")

ans = int(input("Your answer: "))

if ans == a * b:

print("Well done!")

else:

print("That's wrong!")

Explanation:

4 1
3 months ago
Read 2 more answers
The level of the computer hierarchy where an operating system functions is the ______. digital logic level system software level
Natasha_Volkova [1026]
I hold the top position in the hierarchy!
6 0
2 months ago
Read 2 more answers
Which kind of image is indispensable and needs added text to how with it A. a map B. a chart C. a graph or D. a photograph
Amiraneli [1052]
My initial thought would be a photograph. A graph would be my second guess. I trust this reply resolves your inquiry!
4 0
2 months ago
Read 2 more answers
Other questions:
  • java methods Write a program whose input is a character and a string, and whose output indicates the number of times the charact
    10·1 answer
  • Which of these is an example of the integrity principle that can ensure your data is accurate and untampered with?
    10·2 answers
  • You're installing two new hard drives into your network attached storage device. Your director asks that they be put into a RAID
    15·1 answer
  • If a packet gets “sucked down a black hole” (figuratively speaking) and is not received by its sender, and no message is sent ba
    14·1 answer
  • Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to beco
    11·1 answer
  • Remember for a moment a recent trip you have made to the grocery store to pick up a few items. What pieces of data did the Point
    10·1 answer
  • A retailer is able to track which products draw the most attention from its customers through the use of 5g-enabled motion senso
    5·1 answer
  • A large organization is struggling to close the gaps in skill levels that exist between its employees and those from competing c
    11·1 answer
  • 2) Complete the get_num_of_characters() function, which returns the number of characters in the user's string. We encourage you
    11·1 answer
  • When performing actions between your computer and one that is infected with a virus, which of the following offers NO risk of yo
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!