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
What is a core self-evaluation, include identifying and explaining the components of core self-evaluation. And, how a group lead
Brilliant_brown [7]

Answer and Explanation:

Core self-evaluations (CSEs) stands for a wide personality trait that comprises of 4 positive individual traits, namely:

(1) self-efficacy

(2) self esteem

(3) locus of control

(4) emotional stability.

Baiscally, when people have a positive evaluation about themselves, or quality core self-evaluation, they believe that they are worthy and fit for a task. They trust their capability and effectiveness. This leads to some implications in their managers duties and careers, which could either be positive or negative.

A group leader can use CSEs to create a more effective unit by implementing the ten items points of Generalized Self Efficacy Tool to test the self efficiency of individual personnels in that unit.

8 0
3 years ago
Read 2 more answers
How would an engineer know if a product design were feasible?
Masteriza [31]
- the last one ‘design meets all the criteria...’
8 0
3 years ago
Read 2 more answers
Are designed to make it easier for employees to get health and safety Information about
iren [92.7K]

Answer:

what the options

Explanation:

4 0
3 years ago
Suppose there are 76 packets entering a queue at the same time. Each packet is of size 5 MiB. The link transmission rate is 2.1
tia_tia [17]

Answer:

938.7 milliseconds

Explanation:

Since the transmission rate is in bits, we will need to convert the packet size to Bits.

1 bytes = 8 bits

1 MiB = 2^20 bytes = 8 × 2^20 bits

5 MiB = 5 × 8 × 2^20 bits.

The formula for queueing delay of <em>n-th</em> packet is :  (n - 1) × L/R

where L :  packet size = 5 × 8 × 2^20 bits, n: packet number = 48 and R : transmission rate =  2.1 Gbps = 2.1 × 10^9 bits per second.

Therefore queueing delay for 48th packet = ( (48-1) ×5 × 8 × 2^20)/2.1 × 10^9

queueing delay for 48th packet = (47 ×40× 2^20)/2.1 × 10^9

queueing delay for 48th packet = 0.938725181 seconds

queueing delay for 48th packet = 938.725181 milliseconds = 938.7 milliseconds

4 0
3 years ago
Your local hospital is considering the following solution options to address the issues of congestion and equipment failures at
kiruha [24]
Jsjhjrhwjdbwjwjrueiworuuwud
4 0
2 years ago
Other questions:
  • A food-services company with a 480 V, three-phase service entrance has the following set of loads:  A 7 ton walk-in refrigerati
    13·1 answer
  • Air enters a compressor operating at steady state with pressure of 90 kPa, at a temperature of 350 K, and a volumetric flow rate
    13·1 answer
  • A stainless-steel specimen from the same material characterized up above, was formed into a rectangular cross-section of dimensi
    9·1 answer
  • 5. Identify the pros and cons of<br> manufactured siding.
    12·1 answer
  • Users say that the game is interesting to look at but the music gets annoying
    9·1 answer
  • The Hubble Space Telescope is an optical imaging telescope with extremely good angular resolution. Someone discovers an object t
    13·1 answer
  • What did the discovery of the Cumberland Gap mean for exploration? PLEASE HELP ILL GIVE YOU BRAINLEIST!
    15·1 answer
  • Plz give solutions..... ​
    6·1 answer
  • Identify the prefixes used in the International System of
    15·1 answer
  • Your class is using engineering principles to improve the design of football helmets to prevent brain injury. your teacher divid
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!