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
An 80-L vessel contains 4 kg of refrigerant-134a at a pressure of 160kPa. Determine (a) the temperature, (b) the quality, (c) th
makvit [3.9K]

Answer:

temperature -15.6 C, quality x=0.646, enthalpy h=667.20 KJ, volume of vapor phase Vg= 79.8 L

Explanation:

property table for R-134a

https://www.ohio.edu/mechanical/thermo/property_tables/R134a/R134a_PresSat.html

at 160 KPa , temperature = -15.66 C

quality x=mass of vapour/ total mass of liq-vap mixture

alternaternately: x=(v-vf)/(vg-vf)    

v=total volume i.e. volume of container"80L"   80L=0.08 cubic meter

vf=vol of liquid phase  vg=vol of vapor phase vf, vg values at 160Kpa

x=(0.08-0.0007437)/(0.1235-0.0007437)=0.646

enthalpy

h=hf+xhfg          hf, hfg values at 160Kpa

h=hf+xhfg=31.2+0.646(209.9)=166.80 KJ/Kg

for 4Kg R-134a h=m(166.80 KJ/Kg )=667.20 KJ

volume of vapor phase

vg at 160Kpa=0.1235 cubic meter for quality=1.

in this case quality=0.646 , so it will occupy 64.6% space of the vapor phase at quality=1.

vol. of vapor phase=0.646*0.1235=0.0798 cubic meter=79.8 L

7 0
3 years ago
The benefit of using the generalized enthalpy departure chart prepared by using PR and TR as the parameters instead of P and T i
Butoxors [25]
The answer is: a. True
5 0
3 years ago
If you have a hole diameter of 0.250 with a tolerance of ±0.005, what are the limits of the hole size?
sleet_krkn [62]

Answer:

The limits of the hole size are;

The maximum limit of the hole diameter 0.255

The minimum limit of the hole diameter = 0.245

Explanation:

Tolerance is a standardized form of language that can be used to define the intended 'tightness' or 'clearance' degree between mating parts in a mechanical assembly process and in metal joining processes such as welding and brazing processes

In tolerancing, the size used in the description of a part is known as the nominal size while allowable variation of the nominal size that will still allow the part to function properly is known as the tolerance

A tolerance given in the form ±P is known as bilateral tolerancing, with the value being added to or subtracted from the nominal size to get the maximum and minimum allowable limits of the dimensions of the nominal size

Therefore;

The given nominal dimension of the hole diameter = 0.250

The bilateral tolerance of the dimension, = ±0.005

Therefore;

The maximum limit of the diameter of the hole = 0.250 + 0.005 = 0.255

The minimum limit of the diameter of the hole = 0.250 - 0.005 = 0.245

7 0
3 years ago
Subject : SCIENCE
Leviafan [203]

Answer:

Increase the eletric current

slow down the resistance

Explanation:

7 0
2 years ago
All circuits need three basic parts: an energy source, wires, and the object that is going to change the electrical energy into
Radda [10]

load every electric circuit,regardless of where it is or how large or small, has four basic parts: an energy source (ac or dc),a conductor (wire), an electrical load (device), and at least one controller(switch)
7 0
4 years ago
Read 2 more answers
Other questions:
  • 3. Write down the total thermal resistance for a double-pipe heat exchanger. Show how to convert from total resistance to an ove
    12·2 answers
  • Determine the resultant normal force across the cross section at point B. Express your answer to three significant figures and i
    6·1 answer
  • Give a reason why fighter aircraft use mid-wing design.
    11·1 answer
  • A manager has a list of items that have been sorted according to an item ID. Some of them are duplicates. She wants to add a cod
    7·1 answer
  • To test the effects of a new fertilizer, 100 plots were divided in half. Fertilizer A is randomly applied to one half, and B to
    13·2 answers
  • Two engineers are discussing the various merits of hydroelectricity. Engineer A says that tidal barrage systems can generate ele
    6·1 answer
  • What should you consider when choosing the type of hearing protection you use?
    15·1 answer
  • Diffrerentiate y=cos^{4} (3x+1)
    5·1 answer
  • Binary classification algorithm
    9·1 answer
  • Describe the first case where the power of synthesis was used to solve design problems.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!