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]
3 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]3 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
Air at 38°C and 97% relative humidity is to be cooled to 14°C and fed into a plant area at a rate of 510m3/min. (a) Calculate th
Katarina [22]

To develop the problem it is necessary to apply the concepts related to the ideal gas law, mass flow rate and total enthalpy.

The gas ideal law is given as,

PV=mRT

Where,

P = Pressure

V = Volume

m = mass

R = Gas Constant

T = Temperature

Our data are given by

T_1 = 38\°C

T_2 = 14\°C

\eta = 97\%

\dot{v} = 510m^3/kg

Note that the pressure to 38°C is 0.06626 bar

PART A) Using the ideal gas equation to calculate the mass flow,

PV = mRT

\dot{m} = \frac{PV}{RT}

\dot{m} = \frac{0.6626*10^{5}*510}{287*311}

\dot{m} = 37.85kg/min

Therfore the mass flow rate at which water condenses, then

\eta = \frac{\dot{m_v}}{\dot{m}}

Re-arrange to find \dot{m_v}

\dot{m_v} = \eta*\dot{m}

\dot{m_v} = 0.97*37.85

\dot{m_v} = 36.72 kg/min

PART B) Enthalpy is given by definition as,

H= H_a +H_v

Where,

H_a= Enthalpy of dry air

H_v= Enthalpy of water vapor

Replacing with our values we have that

H=m*0.0291(38-25)+2500m_v

H = 37.85*0.0291(38-25)-2500*36.72

H = 91814.318kJ/min

In the conversion system 1 ton is equal to 210kJ / min

H = 91814.318kJ/min(\frac{1ton}{210kJ/min})

H = 437.2tons

The cooling requeriment in tons of cooling is 437.2.

3 0
3 years ago
What should -7/56 BE DIVIDE TO GET -1/8​
aivan3 [116]

Answer:

7/7

Explanation:

7/56 ÷1

7/56÷ 7/7

7/56 ×7/7

1/8

5 0
3 years ago
Read 2 more answers
What is required when setting up a smart phone as a WIFI hotspot?
emmainna [20.7K]
How to create a personal hot spot on an iPhone?

Go to Settings | Cellular | Personal Hotspot.

Tap the slider next to Allow Others to Join. ...

Your Wi-Fi Password will be shown right underneath the Allow Others to Join option. ...

Now, on another device, such as a laptop, go to the Wi-Fi section and search for nearby networks.
5 0
3 years ago
A steel rod, which is free to move, has a length of 200 mm and a diameter of 20 mm at a temperature of 15oC. If the rod is heate
kherson [118]

Explanation:

thermal expansion ∝L = (δL/δT)÷L ----(1)

δL = L∝L + δT ----(2)

we have δL = 12.5x10⁻⁶

length l = 200mm

δT = 115°c - 15°c = 100°c

putting these values into equation 1, we have

δL = 200*12.5X10⁻⁶x100

= 0.25 MM

L₂ = L + δ L

= 200 + 0.25

L₂ = 200.25mm

12.5X10⁻⁶ *115-15 * 20

= 0.025

20 +0.025

D₂ = 20.025

as this rod undergoes free expansion at 115°c, the stress on this rod would be = 0

3 0
3 years ago
Convert mechanical energy into electric energy. What can he use?
Nina [5.8K]

Answer:

<h2>Generator </h2>

Explanation:

A generator converts mechanical energy into electrical energy

7 0
4 years ago
Other questions:
  • Line layout is also called ......​
    5·1 answer
  • (8 points) Consider casting a concrete driveway 40 feet long, 12 feet wide and 6 in. thick. The proportions of the mix by weight
    8·1 answer
  • Water is pumped from one large reservoir to another at a higher elevation. If the flow rate is 2.5 ft3 /s and the pump delivers
    12·1 answer
  • A cylindrical tank with a radius of 2-m is filled with oil and water. The water has a density of rho = 1000 kg/m3 while the oil
    6·1 answer
  • El protozoos es del reino protista?
    14·2 answers
  • The hot-wire anemometer.' A hot-wire anemome ter is essentially a fine wire, usually made of platinum,which is heated electrical
    6·1 answer
  • Running ropes must be taken out of service if they have _____ broken wires in one strad in one lay
    15·2 answers
  • What additive keeps engines clean by preventing contaminants and deposits from collecting on surfaces?
    10·2 answers
  • What are the most used electronic tools for electronic works?​
    13·1 answer
  • Please help me with this question
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!