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
About ceramics: Only can be optically opaque or semi-transparent. a) True b)-False
julia-pushkina [17]

Answer: True

Explanation: Ceramics have the property that when the band gap present between the atoms are larger than the light energy then the tend to become opaque because the light scattering is caused . They also show the property of being translucent when there are chances of the light to get a path through the surface of ceramic so they get the light at some parts e.g.porcelain .Therefore the statement given is true that ceramics can be optically opaque or semi-transparent(translucent).

6 0
3 years ago
What is the effect of the workpiece specific cutting energy on the cutting forces, and why?
ella [17]

Explanation:

Specific cutting energy:

   It the ratio of power required to cut the material to metal removal rate of material.If we take the force required to cut the material is F and velocity of cutting tool is V then cutting power will be the product of force and the cutting tool velocity.

Power P = F x V

Lets take the metal removal rate =MRR

Then the specific energy will be

    sp=\dfrac{F\times V}{MRR}

If we consider that metal removal rate and cutting tool velocity is constant then when we increases the cutting force then specific energy will also increase.

8 0
3 years ago
1. A rectangular fish tank measures 1.5 meters by 2 meters by 20 cm. When it is filled with water, how many kilograms will the w
chubhunter [2.5K]
20kg I’m pretty sure
7 0
3 years ago
Opinion: Choose a side and defend it in four to five sentences. Given the choice between a vehicle that runs on gasoline or one
vaieri [72.5K]

Answer:

my opinion would be electric

Explanation:

because when it comes down to the bare minimum the best choice for the world in the long run would be electric because it puts a big dent back for global warming and the burning of gasses so the more people who drive electric cars are the people who are trying to save the world a little at a time by preventing the burning of gasses. hope this helps :)

6 0
3 years ago
Read 2 more answers
How much energy does it take to boil water for pasta? For a one-pound box of pasta
ArbitrLikvidat [17]

Answer:

a.  164 °F b. 91.11 °C c. 1439.54 kJ

Explanation:

a. [1 pts] How many degrees Fahrenheit (°F) must you raise the temperature?

Since the starting temperature is 48°F and the final temperature which water boils is 212°F, the number of degrees Fahrenheit we would need to raise the temperature is the difference between the final temperature and the initial temperature.

So, Δ°F = 212 °F - 48 °F = 164 °F

b. [2 pts] How many degrees Celsius (°C) must you raise the temperature?

To find the degree change in Celsius, we convert the initial and final temperature to Celsius.

°C = 5(°F - 32)/9

So, 48 °F in Celsius is

°C₁ = 5(48 - 32)/9

°C₁ = 5(16)/9

°C₁ = 80/9

°C₁ = 8.89 °C

Also, 212 °F in Celsius is

°C₂ = 5(212 - 32)/9

°C₂ = 5(180)/9

°C₂ = 5(20)

°C₂ = 100 °C

So, the number of degrees in Celsius you must raise the temperature is the temperature difference between the final and initial temperatures in Celsius.

So, Δ°C = °C₂ - °C₁ = 100 °C - 8.89 °C = 91.11 °C

c. [2 pts] How much energy is required to heat the four quarts of water from

48°F to 212°F (boiling)?

Since we require 15.8 kJ for every degree Celsius of temperature increase of the four quarts of water, that is 15.8 kJ/°C and it rises by 91.11 °C, then the amount of energy Q required is Q = amount of heat per temperature rise × temperature rise =  15.8 kJ/°C × 91.11 °C = 1439.54 kJ

8 0
3 years ago
Other questions:
  • A stream of air enters a 7.00-cm ID pipe at a velocity of 30.0 m/s at 27.0°C and 1.80 bar (gauge). At a point downstrream, the a
    15·1 answer
  • A 3-phase, 50 Hz, 110 KV overhead line has conductors placed in a horizontal plane 3 m apart. Conductor diameter is 2.5 cm. If t
    6·1 answer
  • Suppose a student rubs a Teflon rod with wool and then briefly touches it to an initially neutral aluminum rod suspended by insu
    6·1 answer
  • What structure was created to help prevent shipwrecks?
    9·1 answer
  • • Differentiate between laboratory and industrial reactors​
    11·1 answer
  • If most wildfires are suppressed (all fires are put out) for many years, how does the risk of wildfire in the area change in the
    10·1 answer
  • Air modeled as an ideal gas enters a combustion chamber at 20 lbf/in.2
    10·1 answer
  • How can input from multiple individuals improve design solutions for problems that occur because of a natural disaster, such as
    5·1 answer
  • 19. A circuit contains four 100 S2 resistors connected in series. If you test the circuit with a digital VOM,
    9·1 answer
  • 12. What procedure should you follow when taking measurements?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!