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
s344n2d4d5 [400]
4 years ago
11

2) Write a function called upsidedown_pyramid(height) that acceptsa parameter ""height"". It then prints an upside-down pyramid

of that height.(30

Engineering
1 answer:
DiKsa [7]4 years ago
7 0

Hello, you haven't provided the programing language in which you need the code, I'll explain how to do it using Python, and you can follow the same logic to make a program in the programing language that you need.

Answer:

# -*- coding: utf-8 -*-

#Python

def upsidedown_pyramid(height):

   maximun = (2*(height-1))+1

   for i in range(height): print(' '*i+'*'*(maximun-i*2)+' '*i)

Explanation:

  1. Define your function with an input parameter
  2. Define your maximum, because you are not printing a normal pyramid but an upside-down pyramid you are going to start printing from the maximum number of '*' to just one, but what exactly is the maximum number of '*'? Because you build a pyramid starting with one block, '*', and each level you add two more blocks your formula to calculate the maximum is (2*(height-1))+1
  3. Finally, you have to create a for loop to print each level. You need to start printing zero spaces and the maximum number of blocks, the next level you need two spaces and the maximum number of blocks minus two, and for each level that follows you are increasing by two the number of spaces, one left and one right, and decreasing by two the number of '*'

Note the constructing block of this pyramid is *

You might be interested in
Can someone draw a electric circuit with electrical symbols for this
erastovalidia [21]

Answer:

i cant draw it

i am sry

Explanation:

4 0
3 years ago
Read 2 more answers
Risks in driving are normally less real than we think.<br> False<br> True
nekit [7.7K]
False as there are many risk in driving
7 0
3 years ago
Read 2 more answers
A levee will be constructed to provide some flood protection for a residential area. The residences are willing to accept a one-
777dan777 [17]

Answer:

1709.07 ft^3/s

Explanation:

Annual peak streamflow = Log10(Q [ft^3/s] )

mean = 1.835

standard deviation = 0.65

Probability of levee been overtopped in the next 15 years = 1/5

<u>Determine the design flow ins ft^3/s </u>

P₁₅ = 1 - ( q )^15 = 1 - ( 1 - 1/T )^15 = 0.2

                         ∴  T = 67.72 years

Q₁₅ = 1 - 0.2 = 0.8

Applying Lognormal distribution : Zt = mean + ( K₂ * std ) --- ( 1 )

K₂ = 2.054 + ( 67.72 - 50 ) / ( 100 - 50 ) * ( 2.326 - 2.054 )

    = 2.1504

back to equation 1

Zt = 1.835 + ( 2.1504 * 0.65 )  = 3.23276

hence:

Log₁₀ ( Qt(ft^3/s) ) = Zt  = 3.23276

hence ; Qt = 10^3.23276

                  = 1709.07 ft^3/s

4 0
3 years ago
A platform and a weight totaling 900 N is held in position by a vertical water jet of 5 cm diameter. Determine the velocity of t
BlackZzzverrR [31]

Answer:

v = 21.409 m/s

Explanation:

Given data:

Total weight of the platform and weight together, W = 900 N

Diameter of the water jet = 5 cm = 0.05 m

Now,

the force exerted by the water jet is balancing the platform

also,

Force exerted by the water jet = ρAv²

where,

ρ is the density of the water = 1000 kg/m³

A is the area of the outlet of the jet = \frac{\pi}{4}d^2=\frac{\pi}{4}(0.05)^2

or

A = 0.00196 m²

v is the velocity of the jet

thus,

W = ρAv²

or

900 = 1000 × 0.00196 × v²

or

v = 21.409 m/s

Hence, the velocity of the jet is 21.409 m/s

7 0
3 years ago
When servicing an air bag system, Technician A probes the electrical connectors on the air bag module with a test light; Technic
Fantom [35]
Technician A Is correct
7 0
3 years ago
Other questions:
  • Two parallel surfaces move relative to each other are separated by a gap of 0.375 in. The gap is filled by a fluid of with .0043
    5·1 answer
  • Assume that one component with 256 I/Os is offered in three forms: QFP, full array PBGA, and fl ip chip with gold bumps. The pit
    7·1 answer
  • How to build a laser pointer?
    12·1 answer
  • Ball Throws
    11·1 answer
  • Please help I need by today !!
    11·1 answer
  • VICTV
    11·2 answers
  • I really need a good grade please help
    13·1 answer
  • Do you play escape from tarkov if so do you want to play it with me​
    13·1 answer
  • Which federal agency issues the model food code?
    7·2 answers
  • A gas stream contains 18.0 mole% hexane and the remainder nitrogen. The stream flows to a condenser, where its temperature is re
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!