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
boyakko [2]
3 years ago
14

Implement the function lastChars() that takes a list of strings as a parameter and prints to the screen the last character of ea

ch string, one per line. If the list provided as a parameter is empty, the function prints a message to that effect. If any of the strings are empty, they are skipped in the display. The information below shows how you would call the function lastChars() and what it would display for a couple of parameters:
Engineering
1 answer:
Liono4ka [1.6K]3 years ago
8 0

Answer:

The following program is in C++.

#include <bits/stdc++.h>

using namespace std;

void lastChars(string s)

{

   int l=s.length();

   if(l!=0)

   {

       cout<<"The last character of the string is: "<<s[l-1];

   }

}

int main() {

   string s;//declaring a string..

   getline(cin,s);//taking input of the string..

   lastChars(s);//calling the function..

return 0;

}

Input:-

Alex is going home

Output:-

The last character of the string is: e

Explanation:

In the function lastChars() there is one argument that is a string.I have declared a integer variable l that stores the length of the string.If the length of the string is not 0.Then printing the last character of the string.In the main function I have called the function lastChars() with the string s that is prompted from the user.

You might be interested in
A train travels 650 meters in 25 seconds. What is the train's velocity?
frosja888 [35]

The train is traveling 26 meters A second .

3 0
3 years ago
0-0 what is Boyle’s Law
Dima020 [189]
A law stating that the pressure of a given mass of an ideal gas is inversely proportional to its volume at a constant temperature.

Hope it helps
8 0
3 years ago
How nany degrées is the included angle of General Purpose Acme threads? A. 60 B. 29 c. 14.5 D. 10
horrorfan [7]

Answer:

B.29

Explanation:

In general purpose acme thread:

  Nominal depth of thread=0.5ltimes Pitch

  Included angle =29 degrees

Generally Acme thread are following types

  1.General purpose(G) Acme

  2.Centralizing(C) Acme

  3. Stub Acme  

Centralizing(C) Acme threads have tighter tolerance during manufacturing as compare to General purpose(G) Acme  threads.

8 0
3 years ago
The simply supported beam in the Figure has a rectangular cross-section 150 mm wide and 240 mm high.
8_murik_8 [283]
Same question idea but different values... I hope I helped you... Don't forget to put a heart mark

4 0
3 years ago
Khái niệm về môi trường nhiệt nóng và môi trường nhiện lạnh ?
I am Lyosha [343]

Explanation:

उह्ह्नमजज्ल्ह्ह्बनुतनकुहक्जो

7 0
3 years ago
Other questions:
  • The uniform dresser has a weight of 90 lb and rests on a tile floor for which the coefficient of static friction is 0.25. If the
    6·1 answer
  • How does a carburetor work?
    7·1 answer
  • The uniform slender rod has a mass m.
    5·1 answer
  • I got a rubber band car assigned as a project today. The goal is for the car to go farther/faster than the car my teacher is mak
    6·1 answer
  • 5. After a long period of pumping from an unconfined aquifer at a constant rate of 850 m3/day, the cone of depression reaches eq
    11·1 answer
  • Investiga por que esta simple actividad puede ayudar a mejorar las condiciones ambientales que tu comunidad?
    6·1 answer
  • Question #4
    9·1 answer
  • Which federal agency issues the model food code?
    7·2 answers
  • An interior beam supports the floor of a classroom in a school building. The beam spans 26 ft. and the tributary width is 16 ft.
    11·1 answer
  • Construction support involves mostly what kind of work?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!