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
The bulk density of a compacted soil specimen (Gs = 2.70) and its water content are 2060 kg/m^3 and 15.3%, respectively. If the
yaroslaw [1]

Answer:

the saturated density should be

Explanation:

4 0
3 years ago
Steam enters a turbine at 120 bar, 508oC. At the exit, the pressure and quality are 50 kPa and 0.912, respectively. Determine th
Archy [21]

Answer:

The turbine produces <u>955.53 KW</u> power.

Explanation:

Taking the turbine as a system. Applying Law of Conservation of Energy:

m(h₁ - h₂) - Heat Loss = P

where,

m = mass flow rate of steam = 1.31 kg/s

h₁ = enthalpy at state 1 (120 bar and 508°C)

h₂ = enthalpy at state 2 (50 KPa and x = 0.912)

Heat Loss = 225 KW

P = Power generated by turbine = ?

First, we find h₁ from super steam tables:

At,

T = 508°C

P = 120 bar = 12000 KPa = 12 MPa

we find that steam is in super-heated state with enthalpy:

Due to unavailibility of values in chart we approximate the state to 500° C and 12.5 MPa:

h₁ = 3343.6 KJ/kg

Now, for state 2, we have:

P = 50 KPa and x = 0.912

From saturated steam table:

h₂ = hf₂ + x(hfg₂) = 340.54 KJ/kg + (0.912)(2304.7 KJ/kg)

h₂ = 2442.4 KJ/kg

Now, using values in the conservation equation:

(1.31 kg/s)(3343.6 KJ/kg - 2442.4 KJ/kg) - 225 KW = P

<u>P = 955.53 KW</u>

5 0
3 years ago
Which part of a machine control unit interacts with the machine tools through electric signals?=]
FrozenT [24]

Answer:

control loop unit

Explanation:

Edmentum/Plato

4 0
3 years ago
What do Engineers aim to do
Basile [38]

Answer:

Engineers design, evaluate, develop, test, modify, install, inspect and maintain a wide variety of products and systems.

Explanation:

6 0
2 years ago
Read 2 more answers
If the tank is designed to withstand a pressure of 5 MPaMPa, determine the required minimum wall thickness to the nearest millim
dmitriy555 [2]

Answer: hello some aspects of your question is missing below is the missing information

The gas tank is made from A-36 steel and has an inner diameter of 1.50 m.

answer:

≈ 22.5 mm

Explanation:

Given data:

Inner diameter = 1.5 m

pressure = 5 MPa

factor of safety = 1.5

<u>Calculate the required minimum wall thickness</u>

maximum-shear-stress theory ( σ allow ) = σγ / FS

                                                  = 250(10)^6 / 1.5  = 166.67 (10^6) Pa

given that |σ| = σ allow  

3.75 (10^6) / t = 166.67 (10^6)

∴ t ( wall thickness ) = 0.0225 m   ≈ 22.5 mm

4 0
2 years ago
Other questions:
  • The yield strength of mild steel is 150 MPa for an average grain diameter of 0.038 mm ; yield strength is 250 MPa for average gr
    15·1 answer
  • How was math used to determine new origami crease plans?
    10·1 answer
  • Calculate the diffusion current density for the following carrier distributions. For electrons, use Dn = 35 cm2/s and for holes,
    6·1 answer
  • Which of the following is true Select one: a. HTML stands for Hyper Text Markup Language is a language for describing web pages
    6·1 answer
  • Let CFG G be the following grammar.
    7·2 answers
  • A coal-fired power plant is burning bituminous coal that has an energy content of 12,000 Btu/lb. The power plant is burning the
    13·1 answer
  • - Consider a 2024-T4 aluminum material with ultimate tensile strength of 70 ksi. In a given application, a component of this mat
    7·1 answer
  • 1. You are asked to write a report about one of the structures that Transportation Engineers
    9·1 answer
  • If you have 300 skittles in a bag and you need to have 28 percent yellow. How many yellow skittles would you have to make a mini
    11·1 answer
  • Nec ________ covers selection of time-delay fuses for motor- overload protection.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!