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
Find the resolving power of a Fabry-Perot interferometer in which two silver coated plates have reflectance of ???? = 0.9, if th
pochemuha

Answer:

Resolving Power=625000

Explanation:

See attached picture.

7 0
3 years ago
A hub a signal that refreshes the signal strength.
vekshin1

Answer:You are a network engineer. While moving a handheld wireless LAN device, you notice that the signal strength increases when the device is moved from a ...

Explanation:

7 0
3 years ago
If you deposit today 11,613 in an account earning 8% compound interest, for how long should you invest the money in order to ear
Elanso [62]
Y = a (b)^t/p

y is total money

a is original amount

b is growth / decay factor

t is time

p is the frequency of every growth or decay

15131.76 = 11613 x 1.08^x

15131.76 / 11613 = 1.08^x

1.303… = 1.08^x

log1.303…. = xlog1.08

x = 3.43902165741 years
3 0
2 years ago
Why is concrete on its own not a good material to use
Inga [223]

Answer:

It has poor tensile strength despite having high compressive strength

Explanation:

Concrete exhibits high compressive strength when used. However, it has very low compressive strength. This is the reason why concrete is normally combined with steel to make a composite building material called reinforced concrete. The steel reinforces concrete hence increasing the tensile strength in RC buildings. The end composite is durable and fireproof. Generally, the main reason why concrete is not use on its own is due to its poor tensile strength.

7 0
3 years ago
A gasoline engine has a piston/cylinder with 0.1 kg air at 4 MPa, 1527◦C after combustion, and this is expanded in a polytropic
Roman55 [17]

Answer:

The expansion work is 71.24 kJ and heat transfer is -16.89 kJ

Explanation:

From ideal gas law,

Initial volume (V1) = nRT/P

n is the number of moles of air in the cylinder = mass/MW = 0.1/29 = 0.00345 kgmol

R is gas constant = 8314.34 J/kgmol.K

T is initial temperature = 1527 °C = 1527+273 = 1800 K

P is initial pressure = 4 MPa = 4×10^6 Pa

V1 = 0.00345×8314.34×1800/(4×10^6) = 0.013 m^3

V2 = 10×V1 = 10×0.013 = 0.13 m^3

The process is a polytropic expansion process

polytropic exponent (n) = 1.5

P2 = P1(V1/V2)^n = 4×10^6(0.013/0.13)^1.5 = 1.26×10^5 Pa

Expansion work = (P1V1 - P2V2) ÷ (n - 1) = (4×10^6 × 0.013 - 1.26×10^5 × 0.13) ÷ (1.5 - 1) = 35620 ÷ 0.5 = 71240 J = 71240/1000 = 71.24 kJ

Heat transfer = change in internal energy + expansion work

change in internal energy (∆U) = Cv(T2 - T1)

T2 = PV/nR = 1.26×10^5 × 0.13/0.00345×8314.34 = 571 K

Cv = 20.785 kJ/kgmol.K

∆U = 20.785(571 - 1800) = -25544.765 kJ/kgmol × 0.00345 kgmol = -88.13 kJ

Heat transfer = -88.13 + 71.24 = -16.89 kJ

5 0
3 years ago
Other questions:
  • A heat pump designer claims to have an air-source heat pump whose coefficient of performance is 1.8 when heating a building whos
    10·1 answer
  • Air enters a well-insulated turbine operating at steady, state with negligible velocity at 4 MPa, 300°C. The air expands to an e
    10·1 answer
  • What is the line called that has the red arrow pointing to it in the attached picture?
    6·1 answer
  • Find the general solution of the equation<br>a) Tan A = 1/√3​
    11·1 answer
  • What is the purpose for this experiment
    9·1 answer
  • saan nag tungo si Aguinaldo at ilang pinuno ng kilusan pagkatapos mapairal ang kasunduan na pansamantalang nag dulot ng kapayapa
    6·1 answer
  • Select the correct answer.
    11·1 answer
  • A plant has ten machines and currently operates two 8-hr shift per day, 5 days per week, 50 weeks per year. the ten machines pro
    6·1 answer
  • Question 2
    12·1 answer
  • A technician is building a high-performance gaming pc. which two items should the technician focus on selecting parts for the ma
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!