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
(25) Consider the mechanical system below. Obtain the steady-state outputs x_1 (t) and x_2 (t) when the input p(t) is the sinuso
sammy [17]
Njjhvgghjjjhhhhhhhb hhh. I h. I’ve. Know
5 0
3 years ago
What material property would still cause strain in a strain gauge that is positionedperpendicular to the direction of force if i
svetlana [45]

Answer:

oof

Explanation:

I don't know but please don't report me

I am trying to do a challenge

Thank you-

If you don't report me!

5 0
3 years ago
Air at 293k and 1atm flow over a flat plate at 5m/s. The plate is 5m wide and 6m long. (a) Determine the boundary layer thicknes
loris [4]

Answer:

a). 8.67 x 10^{-3} m

b).0.3011 m

c).0.0719 m

d).0.2137 N

e).1.792 N

Explanation:

Given :

Temperature of air, T = 293 K

Air Velocity, U = 5 m/s

Length of the plate is L  = 6 m

Width of the plate is b = 5 m

Therefore Dynamic viscosity of air at temperature 293 K is, μ = 1.822 X 10^{-5} Pa-s

We know density of air is ρ = 1.21 kg /m^{3}

Now we can find the Reyonld no at x = 1 m from the leading edge

Re = \frac{\rho .U.x}{\mu }

Re = \frac{1.21 \times 5\times 1}{1.822\times 10^{-5} }

Re = 332052.6

Therefore the flow is laminar.

Hence boundary layer thickness is

δ = \frac{5.x}{\sqrt{Re}}

   = \frac{5\times 1}{\sqrt{332052.6}}

   = 8.67 x 10^{-3} m

a). Boundary layer thickness at x = 1 is δ = 8.67 X 10^{-3} m

b). Given Re = 100000

    Therefore the critical distance from the leading edge can be found by,

     Re = \frac{\rho .U.x}{\mu }

     100000 = \frac{1.21\times5\times x}{1.822 \times10^{-5}}

     x = 0.3011 m

c). Given x = 3 m from the leading edge

    The Reyonld no at x = 3 m from the leading edge

     Re = \frac{\rho .U.x}{\mu }

     Re = \frac{1.21 \times 5\times 3}{1.822\times 10^{-5} }

     Re = 996158.06

Therefore the flow is turbulent.

Therefore for a turbulent flow, boundary layer thickness is

    δ = \frac{0.38\times x}{Re^{\frac{1}{5}}}

       = \frac{0.38\times 3}{996158.06^{\frac{1}{5}}}

       = 0.0719 m

d). Distance from the leading edge upto which the flow will be laminar,

  Re = \frac{\rho \times U\times x}{\mu }

5 X 10^{5} = \frac{1.21 \times 5\times x}{1.822\times 10^{-5}}}

 x = 1.505 m

We know that the force acting on the plate is

F_{D} = \frac{1}{2}\times C_{D}\times \rho \times A\times U^{2}

and C_{D} at x= 1.505 for a laminar flow is = \frac{1.328}{\sqrt{Re}}

                                                                         = \frac{1.328}{\sqrt{5\times10 ^{5}}}

                                                                       = 1.878 x 10^{-3}

Therefore, F_{D} =  \frac{1}{2}\times C_{D}\times \rho \times A\times U^{2}

                                          = \frac{1}{2}\times 1.878\times 10^{-3}\times 1.21\times (5\times 1.505)\times 5^{2}

                                         = 0.2137 N

e). The flow is turbulent at the end of the plate.

  Re = \frac{\rho \times U\times x}{\mu }

       = \frac{1.21 \times 5\times 6}{1.822\times 10^{-5} }

       = 1992316

Therefore C_{D} = \frac{0.072}{Re^{\frac{1}{5}}}

                                           = \frac{0.072}{1992316^{\frac{1}{5}}}

                                           = 3.95 x 10^{-3}

Therefore F_{D} = \frac{1}{2}\times C_{D}\times \rho\times A\times U^{2}

                                           = \frac{1}{2}\times 3.95\times 10^{-3}\times 1.21\times (5\times 6)\times 5^{2}

                                          = 1.792 N

3 0
3 years ago
Two variables, num_boys and num_girls, hold the number of boys and girls that have registered for an elementary school. The vari
Flauer [41]

Answer:

Using python

num_boys = int(input("Enter number of boys :"))

num_girls = int(input("Enter number of girls :"))

budget = int(input("Enter the number of dollars spent per school year :"))

try:

dollarperstudent = budget/(num_boys+num_girls)

print("Dollar spent per student : "+str(dollarperstudent))#final result

except ZeroDivisionError:

print("unavailable")

3 0
3 years ago
Note that common skills are listed toward the top, and less common skills are listed toward the bottom.
Sladkaya [172]

Answer:

BDEG

Explanation:

got it right on the test on edge because i used my b r a i n

5 0
3 years ago
Other questions:
  • Biologists use a sequence of letters A, C, T, and G to model a genome. A gene isa substring of a genome that starts after a trip
    5·1 answer
  • What is centrifugal force with respect to unbalance? What is the formula used to determine centrifugal force?
    12·1 answer
  • why HF (hydrogen fluoride) has higher boiling temperature than HCl (hydrogen chloride), even thought HF has lower molecular weig
    8·1 answer
  • An air conditioner using refrigerant-134a as the working fluid and operating on the ideal vapor-compression refrigeration cycle
    7·2 answers
  • It has been estimated that 139.2x10^6 m^2 of rainforest is destroyed each day. assume that the initial area of tropical rainfore
    12·1 answer
  • Item110pointseBook HintPrintReferences Check my work Check My Work button is now disabled5Item 1Item 1 10 pointsAn ideal Diesel
    10·1 answer
  • 9. An elevator on a construction site is being operated at rated capacity of 6 tons, and is supported by two standard steel cabl
    7·1 answer
  • thanh thẳng AD có kích thước và chịu lực như hình.biết P1 = 10kn, p2=5kn,M=15kn*m,a=2m.Hãy xách định phản lực liên kết tại A,b
    14·1 answer
  • ​please how to drawing mechanical drawing after connecting the all parts thanks
    6·1 answer
  • A system of organization, people activities, informations, and resources involved in supplying a productor or service to a custo
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!