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
alexandr402 [8]
3 years ago
7

5. Create a function named second_a that uses a list comprehension. The function will take a single integer parameter n. Find ev

ery number from 1 to n (inclusive) that is a palindrome which starts with the digit 3. Do not user a helper function.
Engineering
1 answer:
Mekhanik [1.2K]3 years ago
8 0

Answer:

//Program was implemented using C++ Programming Language

// Comments are used for explanatory purpose

#include<iostream>

using namespace std;

unsigned int second_a(unsigned int n)

{

int r,sum=0,temp;

int first;

for(int i= 1; I<=n; i++)

{

first = n;

//Check if first digit is 3

// Remove last digit from number till only one digit is left

while(first >= 10)

{

first = first / 10;

}

if(first == 3) // if first digit is 3

{

//Check if n is palindrome

temp=n; // save the value of n in a temporary Variable

while(n>0)

{

r=n%10; //getting remainder

sum=(sum*10)+r;

n=n/10;

}

if(temp==sum)

cout<<n<<" is a palindrome";

else

cout<<n<<" is not a palindrome";

}

}

}

Explanation:

The above code segments is a functional program that checks if a number that starts with digit 3 is Palindromic or not.

The program was coded using C++ programming language.

The main method of the program is omitted.

Comments were used for explanatory purpose.

You might be interested in
The 2-kg package leaves the conveyor belt at with a speed of vA = 1 m/s and slides down the smooth ramp. Determine the required
Kisachek [45]

Answer:

Incomplete question: Find the normal reaction the curved portion of the ramp exerts on the package at B if pB = 2 m, the height is 4 m

Answer: The required speed is 8.9107 m/s

The normal reaction is 99.0006 N

Explanation:

Given data:

m = 2 kg

vA = speed = 1 m/s

h = 4 m

g = gravity = 9.8 m/s²

Questions: Determine the required speed of the conveyor, vc = ?

Find the normal reaction, Nc = ?

The required speed applying the conservation of energy:

\frac{1}{2} mv_{A}^{2}  +mgh=\frac{1}{2} mv_{c} ^{2}

Solving for vc:

v_{c} =\sqrt{v_{A}^{2}+2gh  } =\sqrt{1^{2}+(2*9.8*4) } =8.9107m/s

The normal reaction applying the equilibrium of forces:

N_{c} -mg=m(\frac{v_{c}^{2}  }{p_{B} } )

N_{c} =2*(\frac{8.9107^{2} }{2} )+(2*9.8)=99.0006N

3 0
3 years ago
A tank containing diesel fuel(SG = 0.8) is open to the atmosphere at the top. A U-tube manometer is connected to the bottom of t
stepan [7]

Answer:

h= 37.9 m

Explanation:

Given that

SG = 0.8 for fuel so density of fluid will be 800 kg/m³.

We know that SG = 13.6 For Hg so density will be 13600 kg/m³.

Now by balancing the pressure

\rho_d\times g\times h +\rho_d\times g\times 1.2 =\rho_{hg}\times g\times 2.3

800\times 9.81\times h+ 800\times 9.81\times 1.2 =13600\times 9.81\times 2.3

800\times 9.81\times h =13600\times 9.81\times 2.3-800\times 9.81\times 1.2

h=\dfrac{297439.2}{800\times 9.81}

h= 37.9 m

8 0
3 years ago
Read 2 more answers
Rr4rrrjrjdjdjdjdndndndnndjdjdjndjdjdkdkd
vodomira [7]

Answer:

37 degrees Fahrenheit

4 0
3 years ago
Read 2 more answers
What do shoes have in the toe area?
Savatey [412]

Answer: it called a toe box is the part of a shoe that covers and protects the toes. Toe boxes come in a variety of shapes and styles depending on the type of shoe, but they should always be wide and long enough to accommodate the toes comfortably.

Explanation:

6 0
4 years ago
Indicate appropriate brick and mortar selections for each of the following situations by mentioning the minimum brick strength g
gizmo_the_mogwai [7]

Answer: debido al movimiento de traslación se produce este fenómeno se mueve el ecuador de la rotación terrestre se nación del eje terrestre y de las estaciones cuál de todos

Explanation:

5 0
3 years ago
Other questions:
  • What are the parameters that affect life and drag forces on an aerofoil?
    13·1 answer
  • A force 25 N makes an angle of 30,45 and 75 degree with x,y and z axis. What should be the corresponding force vector?
    8·1 answer
  • The shaft is made of A992 steel. It has a diameter of 1 in. and is supported by bearings at A and D, which allows free rotation.
    11·1 answer
  • Show that -40 F is approximately equal to -40 C.
    12·1 answer
  • A 3.7 g mass is released from rest at C which has a height of 1.1 m above the base of a loop-the-loop and a radius of 0.2 m . Th
    10·1 answer
  • Acoke can with inner diameter(di) of 75 mm, and wall thickness (t) of 0.1 mm, has internal pressure (pi) of 150 KPa and is suffe
    9·1 answer
  • 15 POINTS! Help.
    9·2 answers
  • Is the gap store an example of commercial construction? Yes or no
    10·1 answer
  • Solid Isomorphous alloys strength
    8·1 answer
  • Define waves as it applies to electromagnetic fields
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!