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 high molecular weight hydrocarbon gas A is fed continuously into a heated mixed flow reactor (0.1liter) where it is thermally
dimulka [17.4K]

Answer:

Space velocity = 30 hr⁻¹

Explanation:

Space velocity for reactors express how much reactor volume of feed or reactants can be treated per unit time. For example, a space velocity of 3 hr⁻¹ means the reactor can process 3 times its volume per hour.

It is given mathematically as

Space velocity = (volumetric flow rate of the reactants)/(the reactor volume)

Volumetric flowrate of the reeactants

= (molar flow rate)/(concentration)

Molar flowrate of the reactants = 300 millimol/hr

Concentration of the reactants = 100 millimol/liter

Volumetric flowrate of the reactants = (300/100) = 3 liters/hr

Reactor volume = 0.1 liter

Space velocity = (3/0.1) = 30 /hr = 30 hr⁻¹

Hope this Helps!!!

5 0
4 years ago
To provide some perspective on the dimensions of atomic defects, consider a metal specimen that has a dislocation density of 105
GenaCL600 [577]

Answer:

62.14\ \text{miles}

6213727.37\ \text{miles}

Explanation:

The distance of the chain would be the product of the dislocation density and the volume of the metal.

Dislocation density = 10^5\ \text{mm}^{-2}

Volume of the metal = 1000\ \text{mm}^3

10^5\times 1000=10^8\ \text{mm}\\ =10^5\ \text{m}

1\ \text{mile}=1609.34\ \text{m}

\dfrac{10^5}{1609.34}=62.14\ \text{miles}

The chain would extend 62.14\ \text{miles}

Dislocation density = 10^{10}\ \text{mm}^{-2}

Volume of the metal = 1000\ \text{mm}^3

10^{10}\times 1000=10^{13}\ \text{mm}\\ =10^{10}\ \text{m}

\dfrac{10^{10}}{1609.34}=6213727.37\ \text{miles}

The chain would extend 6213727.37\ \text{miles}

3 0
3 years ago
The distribution of actual weights of 8‑ounce wedges of cheddar cheese produced at a dairy is Normal, with mean 8.1 ounces and s
s344n2d4d5 [400]

Answer:

sampling distribution

Explanation:

Sampling distribution is distribution of multiple samples' satistics of a population.

3 0
4 years ago
Two Technicians are discussing ShopKey Pro. Technician
Leno4ka [110]

Answer:

Technician B

Explanation:

i took he test already

6 0
3 years ago
It is appropriate to use the following yield or failure criterion for ductile materials (a) Maximum shear stress or Tresca crite
Nataly [62]

Answer:

(b)Distortion energy theory.

Explanation:

The best suitable theory for ductile material:

       (1)Maximum shear stress theory (Guest and Tresca theory)

It theory state that applied maximum shear stress should be less or equal to its maximum shear strength.

      (2)Maximum distortion energy theory(Von Mises henkey's        theory)

It states that maximum shear train energy per unit volume at any point  is equal to strain energy per unit volume under the state of uni axial stress condition.

But from these two Best theories ,suitable theory is distortion energy theory ,because it gives best suitable result for ductile material.

6 0
3 years ago
Other questions:
  • In Visual Basic/Visual Studio, characteristics of controls, such as the Name of the control, or the Text displayed on the contro
    10·1 answer
  • You have designed a bone plate that is manufactured via rolling under cold working conditions, and tests show good biocompatibil
    14·1 answer
  • Assume the triac of an AC discrete output module fails in the shorted state. How would this affect the device connected to this
    5·1 answer
  • 2.31 LAB: Simple statistics Part 1 Given 4 integers, output their product and their average, using integer arithmetic. Ex: If th
    5·2 answers
  • What is the thermal efficiency of this reheat cycle in terms of enthalpies?
    11·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
  • Unitate de masura in SI pt F​
    11·1 answer
  • Technician A states that a scan tool can read
    13·1 answer
  • IF A CAR AHEAD OF YOU HAS STOPPED AT A CROSSWALK, YOU SHOULD:
    12·1 answer
  • Is the science of measurement
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!