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
It is true about Metals and alloys: a)-They are good electrical and thermal conductors b)-They can be used as semi-conductors c)
ycow [4]

Answer:

(d) a and c are correct

Explanation:

METALS : Metal are those materials which has very high ductility, high modulus of elasticity, good thermal and electrical conductivity

for example : iron, gold ,silver, copper

ALLOYS: Alloys are those materials which are made up of combining of two or more than two metals these also have good thermal and electrical conductivity and me liable property

for example ; bronze and brass

so from above discussion it is clear that option (d) will be the correct option

8 0
3 years ago
Read 2 more answers
(a) For a given material, would you expect the surface energy to be greater than, the same as, or less than the grain boundary e
aksik [14]

Answer:

(a) Surface energy is greater than grain boundary energy due to the fact that the bonds of the atoms on the surface are lower than those of the atoms at the grain boundary. The energy is also directly proportional to the number of bonds created.

(b) The energy of a high-angle grain boundary is higher than that of a small-angle grain boundary because the high-angle grain boundary has a higher misalignment and smaller number of bonds than a small-angle grain boundary.

Explanation:

(a) Surface energy is greater than grain boundary energy due to the fact that the bonds of the atoms on the surface are lower than those of the atoms at the grain boundary. The energy is also directly proportional to the number of bonds created.

(b) The energy of a high-angle grain boundary is higher than that of a small-angle grain boundary because the high-angle grain boundary has a higher misalignment and smaller number of bonds than a small-angle grain boundary.

5 0
3 years ago
A full-adder is a combinational circuit that forms the arithmetic sum of three input bits.
Vinvika [58]
(b) correct it is false
5 0
3 years ago
1. Two technicians are discussing tire rotation. Technician A says that you always follow the tire-rotation procedure outlined i
siniylev [52]

Answer:

don't know

Explanation:

huhuh

8 0
3 years ago
Which is not an affect of alcohol
Gre4nikov [31]
Pooping problems is not an affect
6 0
3 years ago
Other questions:
  • A cylindrical specimen of brass that has a diameter of 20 mm, a tensile modulus of 110 GPa, and a Poisson’s ratio of 0.35 is pul
    13·1 answer
  • Zona intermedia de pozos <br> Y<br> Efecto de inavasion
    6·1 answer
  • How does fouling affects the performance of a heat exchanger?
    6·1 answer
  • Entropy change is evaluated using Eq. 6.2a based on an internally reversible process. Can the entropy change between two states
    14·1 answer
  • What is stress corrosion cracking?
    9·1 answer
  • Air at atmospheric pressure and at 300K flows with a velocity of 1.5m/s over a flat plate. The transition from laminar to turbul
    13·1 answer
  • The use of zeroes after a decimal point are an indicator of accuracy. a)True b)- False
    7·1 answer
  • A cylindrical specimen of some metal alloy having an elastic modulus of 124 GPa and an original cross-sectional diameter of 4.2
    13·1 answer
  • Select the correct answer <br><br> What is the simplest definition of a manufacturing process?
    5·2 answers
  • Which alpha-numeric designator, systematically assigned at the time of manufacture, identifies the manufacturer, month, year, lo
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!