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
Intravenous infusions are usually driven by gravity by hanging the bottle at a sufficient height to counteract the blood pressur
Bingel [31]

Answer:

(a) BP = 11.99 KPa

(b) h = 2 m

Explanation:

(a)

Since, the fluid pressure and blood pressure balance each other. Therefore:

BP = ρgh

where,

BP = Blood Pressure

ρ = density of fluid = 1020 kg/m³

g = acceleration due to gravity = 9.8 m/s²

h = height of fluid = 1.2 m

Therefore,

BP = (1020 kg/m³)(9.8 m/s²)(1.2 m)

<u>BP = 11995.2 Pa = 11.99 KPa</u>

(b)

Again using the equation:

P = ρgh

with data:

P = Gauge Pressure = 20 KPa = 20000 Pa

ρ = density of fluid = 1020 kg/m³

g = acceleration due to gravity = 9.8 m/s²

h = height of fluid = ?

Therefore,

20000 Pa = (1020 kg/m³)(9.8 m/s²)h

<u>h = 2 m</u>

7 0
3 years ago
Since the passing of the Utah GDL laws in 1999:
wlad13 [49]
The answer is b, I hope this helps you
7 0
3 years ago
‏What is the potential energy in joules of a 12 kg ( mass ) at 25 m above a datum plane ?
Virty [35]

Answer:

E = 2940 J

Explanation:

It is given that,

Mass, m = 12 kg

Position at which the object is placed, h = 25 m

We need to find the potential energy of the mass. It is given by the formula as follows :

E = mgh

g is acceleration due to gravity

E=12\times 9.8\times 25\\\\E=2940\ J

So, the potential energy of the mass is 2940 J.

3 0
3 years ago
(True/False) Unix is written in the C language. *<br> True<br> O False
Katarina [22]

Answer:

false

Explanation:

8 0
3 years ago
Read 2 more answers
Four of the minterms of the completely specified function f(a, b, c, d) are m0, m1, m4, and m5.
Sveta_85 [38]

Complete Question

The complete question is shown on the first uploaded image

Answer:

a) The required additional minterms  for f so that f has eight primary implicants with two literals and no other prime implicant are m_{2},m_{3},m_{7},m_{8},m_{11},m_{12},m_{13},m_{14} and m_{15}

b) The essential prime implicant are c' d',a'b',ab and cd

c) The minimum sum-of-product expression for f are

                  a'b' +ab +c'd'+cd+a'c',\\ a'b'+ab+c'd'+cd+a'd,\\a'b'+ab+c'd'+cd+bc'  and  \\ a'b'+ab+c'd' +cd+bd

Explanation:

The explanation is shown on the second third and fourth image

8 0
3 years ago
Other questions:
  • Help me! Phone Phoebe on 07375410044.
    7·2 answers
  • Which section of business plan should be the bulk of the plan
    7·1 answer
  • For the system in problem 4, suppose a main memory access requires 30ns, the page fault rate is .01%, it costs 12ms to access a
    14·1 answer
  • For Laminar flow conditions, what size pipe will deliver 90 gpm of medium oil at 40°F (υ = 6.55 * 10^‐5)?
    12·1 answer
  • Which one is dependent variable?
    13·1 answer
  • Find the remaining trigonometric functions of 0 if
    10·1 answer
  • What Is Photosynthesis ?​
    7·2 answers
  • Workers who work with what kind of chemicals chemicals may require regular medical checkups on a more frequent basis as a result
    15·1 answer
  • Select three types of lines that engineers use to help represent the shape of a design in a sketch.
    14·1 answer
  • A fully charged new battery will have a low conductance reading.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!