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
Sonja [21]
4 years ago
10

Write a function called pyramid(height) that acceptsa parameter ""height"". It then prints a pyramid of that height

Engineering
1 answer:
vichka [17]4 years ago
5 0

Answer:

I am writing a function in C++                              

Explanation:

<h2>C++ program</h2>

#include <iostream>

using namespace std;

int pyramid(int height) // function pyramid with parameter height

{int distance; //variable for spaces

   for(int i = 1, j = 0; i <= height; ++i, j= 0)  //handle the rows

   {

for(distance= 1; distance<= height-i; ++distance)

// handles the spaces & columns

    { cout <<"  ";        } //prints spaces between stars

       while(j!= 2*i-1)  //handles shape and spaces

       {   cout << "* "; // printing stars

           ++j;        }

       cout << '\n';    }   } // for the next line

int main()

{

int height; //declare height variable

cout <<"Enter height of pyramid "; //asks user to enter height of pyramid

cin>>height; //stores value of height

pyramid(height); //calls pyramid function

}

You might be interested in
What is the function of a regulator?
elena55 [62]
The function if I’m not correct just text me but 3
3 0
3 years ago
Find the mass if the force is 18 N and the acceleration is 2 m/s2
Nana76 [90]

Explanation:

f = ma

m = f/a

= 18N / 2m/s2

= 9kg

5 0
3 years ago
Read 2 more answers
A centrifugal pump is required to pump water to an open water link situated 4 km away from the location of the pump through a pi
11111nata11111 [884]

Answer:

P= 5.5 bar

Explanation:

Given that

L= 4000 m

d= 0.2 m

Friction factor(F) = 0.01

speed V= 2 m/s

Head = 5 m

Head loss due to friction

h_f=\dfrac{FLV^2}{2gd}

h_f=\dfrac{0.01\times 4000\times 2^2}{2\times 9.81\times 0.2}

h_f=40.77m

So the total head(H) = 5 + 40.77 + 10.3 =56.07

Where 10.3 m is the atmospheric head.

We know that

P=ρ g H

So total Pressure

P= 1000 x 9.81 x 56.07 Pa

P=5.5\times 10^5\ Pa

P= 5.5 bar

5 0
4 years ago
A two-bus power system is interconnected by one transmission line. Bus 1 is a generator bus with specified terminal voltage magn
mixas84 [53]

Answer:

a) | v2 | ,  β2   ( load, bus voltage at bus 2 )

  p1 ,  q1 ( slack, bus power at bus 1 )

b) q2 , β2  

  p1 and q1 ( slack, bus power at bus 1 )

Explanation:

Attached below is a schematic representation of the solution

<u>a) Identify the variables in the solution vector assume Bus 2 is a load bus</u>

The specified parameters are ; P2 and q2

while | v2 | and β2 are not specified

given that bus 2 is a load bus, bus 1 is a slack bus with ; | v1 |  and β1 been specified while p1 and q1 are not specified

<em>Hence the variables in the solution </em>

<em>= | v2 | ,  β2   ( load, bus voltage at bus 2 )</em>

<em>   p1 ,  q1 ( slack, bus power at bus 1 ) </em>

<u>b) Identify the variables in the solution vector ( assume Bus 2 is a PV bus )</u>

specified at Bus 2 are ; | p2 | , | v2 |

unspecified : q2 , β2

Bus 1 ( still a slack bus )

specified parameter : | v1 |  and β1

unspecified : p1 and q1

<em>Hence the variables in the solution </em>

<em>= q2 , β2  </em>

<em>   p1 and q1 ( slack, bus power at bus 1 ) </em>

7 0
3 years ago
A smooth ceramic sphere (SG 5 2.6) is immersed in a fl ow of water at 208C and 25 cm/s. What is the sphere diameter if it is enc
Aleks [24]

Answer:

a. 4\mu m

b. 1 m

Explanation:

According to the question, the data is as follows

The Density of water at 20 degrees celcius is 1000 kg/m^3

Viscosity is 0.001kg/m/.s

Velocity V = 25 cm/s

V = 0.25 m/s

Now

a. The creeping motion is

As we know that

Reynold Number = (Density of water × V × d) ÷ (Viscosity)

1 = (1,000 × 0.25 × d) ÷ 0.0001

d = (1 × 0.001) ÷ (1,000 × 0.25)

= 4E - 06^m

= 4\mu m

b. Now the sphere diameter is

Reynold Number = (Density of water × V × d) ÷ (Viscosity)

250,000 = (1,000 × 0.25 × d) ÷ 0.0001

d = (250,000 × 0.001) ÷ (1,000 × 0.25)

= 1 m

6 0
3 years ago
Other questions:
  • The steel bar has a 20 x 10 mm rectangular cross section and is welded along section a-a. The weld material has a tensile yield
    11·1 answer
  • Design a circuit with output f and inputs x1, x0, y1, and y0. Let X = x1x0 and Y = y1y0 represent two 2-digit binary numbers. Th
    10·1 answer
  • Tranquilizing drugs that inhibit sympathetic nervous system activity often effectively reduce people's subjective experience of
    8·1 answer
  • In many problems where the potential energy is considered between two objects, the potential energy is defined as zero when the
    8·1 answer
  • The water behind Hoover Dam in Nevada is 221 m higher than the Colorado River below it. At what rate must water pass through the
    6·1 answer
  • A soil element is subjected to a minor principle stress of 50 kPa on a plane rotated 20 ° counterclockwise from vertical. If the
    10·1 answer
  • How did humans create a space suit without ever going. How did we know spaces conditions?
    5·2 answers
  • Which component found in fertilizer is a known cancer-causing agent?
    11·2 answers
  • The distribution of SAT scores of all college-bound seniors taking the SAT in 2014 was approximately normal with mean μ=1497 and
    12·1 answer
  • Which of the following might a cement mason or concrete finisher be responsible for? (Select all that apply).
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!