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
Anarel [89]
2 years ago
13

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

g of 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.
fading trailing batting
Write the code segment as described above. The code segment must use an enhanced for loop.
Computers and Technology
1 answer:
finlep [7]2 years ago
4 0

Answer:

Explanation:

#include <iostream>

using namespace std;

int main()

{

   string cwords[8]={"ten", "fading", "post", "card", "thunder", "hinge", "trailing", "batting"};

   string temp="";

   for (int i=0; i<8; i++)

   {

       temp=cwords[i];

       int j=temp.length();

       if (temp[j-3]=='i' && temp[j-2]=='n' && temp[j-1]=='g')

       {

           cout<<temp<<endl;

       }

   }

   return 0;

}

You might be interested in
Ethan wants to change the font in his document. He should _____.
guapka [62]

Answer:

C because it will work. I tried that a lot of time with documents.

Explanation:

6 0
3 years ago
Add Try/Catch error checking To make sure that the user enters valid values in your program. To catch negative values passed to
ryzh [129]

Answer:

int main()

{

 cout<<"Enter the size of array\n";

 int n;

 try{

 cin>>n;//get size of array

 if (n > 0){

 List list;//make object of list class

 try{

     list.init(n);//initialize the list

     list.fillData();//fill the data

     list.print();//print the data

     list.sortData();//sort the  data

     cout<<"\n--- After sorting the data---\n";

     list.print();//print the data

     cout<<"Enter the element to search\n";

     int x;

     cin>>x;//get element to search

     list.searchElement(x);//call the search function

 }

 catch (std::bad_alloc){

   cout<<"Sorry, could not allocate memory for list object.";

 }

 }else{

   throw('Negative Number detected');

 }

 }

 catch (int n){

   cout<<"The number should be a positive integer.";

 }

   return 0;

}

Explanation:

The try and catch keywords come in pairs, as they are used to control exceptions in the C++ source code. The try keyword checks for error in the source code given the condition (if the n integer variable is greater than 0). If the condition is met, the code in the try code block runs otherwise the catch keyword catches the error of a negative number (if the n variable in less than 0).

4 0
3 years ago
I need an answer fast !!! (APEX)
lana [24]
Your answer is B)<span>The Intel 4004</span>
3 0
3 years ago
How to be fluent in computer
Setler79 [48]

Explanation:

1. Seeing people do technological innovations, so you have some motivation and inspiration to be fluent in computer

2. Try experimenting and trying stuff, like trying to learn how to code, how the internet work, etc.

3. work more with computers, for example, make a note with OneNote, making digital art with blender, adobe illustrator etc.

4. Try to learn how to be better at learning computer, like, if you do mistakes in your learning journey, try to avoid it next time

5. good luck ;)

7 0
2 years ago
Read 2 more answers
Vannevar bush imagined a desktop computing machine that would allow people to access data stored in various information centers
Bas_tet [7]
I'm pretty sure it is A) Memex.
5 0
3 years ago
Other questions:
  • Hot five was the famous band of which musician?
    14·1 answer
  • 15) the following statement describes government depository librearies , except:
    12·1 answer
  • Which security control is most helpful in protecting against eavesdropping on wireless LAN (WLAN) data transmissions that would
    6·1 answer
  • Anyone know the answer I need help
    12·1 answer
  • Identify some advantages of using Excel over lists, paper files, or simple word documents? Describe some disadvantages of using
    15·1 answer
  • Which line of code will find the first occurrence of a three in an array?
    5·2 answers
  • Which of the following statements best illustrates how value was created for eggs? when a farmer sells a chicken who is no longe
    9·1 answer
  • What power points feature will you use to apply motion effects to different objects of a slide
    5·1 answer
  • What are Database administrators? <br> Thank you :)
    7·1 answer
  • Differentiate between patent and copyright.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!