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
Bằng lý luận và thực tiễn, bạn hãy trình bày ý kiến của mình về quan điểm sau đây: "Quá trình dạy học là quá trình truyền thụ tr
mrs_skeptik [129]

Answer:

can you please ask in English I can't understand this language

7 0
2 years ago
One method that is used to grow nanowires (nanotubes with solid cores) is to initially deposit a small droplet of a liquid catal
7nadin3 [17]

Answer: maximum length of the nanowire is 510 nm

Explanation:

 

From the table of 'Thermo physical properties of selected nonmetallic solids at At T = 1500 K

Thermal conductivity of silicon carbide k = 30 W/m.K

Diameter of silicon carbide nanowire, D = 15 x 10⁻⁹ m  

lets consider the equation for the value of m

m = ( (hP/kAc)^1/2 )  = ( (4h/kD)^1/2 )  

m =  ( ((4 × 10⁵)/(30×15×10⁻⁹ ))^1/2 ) = 942809.04    

now lets find the value of h/mk    

h/mk = 10⁵ / ( 942809.04 × 30) =  0.00353

lets consider the value θ/θb by using the equation

θ/θb = (T - T∞) / (T - T∞)

θ/θb =  (3000 - 8000) / (2400 - 8000)

= 0.893

the temperature distribution at steady-state is expressed as;

θ/θb = [ cosh m(L - x) + ( h/mk) sinh m (L - x)]   / [cosh mL+  (h/mk) sinh mL]

θ/θb = [ cosh m(L - L) + ( h/mk) sinh m (L - L)]   / [cosh mL+  (h/mk) sinh mL]

θ/θb = [ 1 ]  / [cosh mL+  (h/mk) sinh mL]

so we substitute

0.893 =  [ 1 ]  / [cosh (942809.04 × L) +  (0.00353) sinh (942809.04 × L)]

L = 510 × 10⁻⁹m

L = 510 nm

therefore maximum length of the nanowire is 510 nm

4 0
3 years ago
A beam has a rectangular cross section that is 5 inches wide and 1.5 inches tall. The supports are 60 inches apart and with a 12
nydimaria [60]

Answer:

The value of Modulus of elasticity E = 85.33 × 10^{6} \frac{lbm}{in^{2} }

Beam deflection is = 0.15 in

Explanation:

Given data

width = 5 in

Length = 60 in

Mass of the person = 125 lb

Load = 125 × 32 = 4000\frac{ft lbm}{s^{2} }

We know that moment of inertia is given as

I = \frac{bt^{3} }{12}

I = \frac{5 (1.5^{3} )}{12}

I = 1.40625 in^{4}

Deflection = 0.15 in

We know that deflection of the beam in this case is given as

Δ = \frac{PL^{3} }{48EI}

0.15 = \frac{4000(60)^{3} }{48 E (1.40625)}

E = 85.33 × 10^{6} \frac{lbm}{in^{2} }

This is the value of Modulus of elasticity.

Beam deflection is = 0.15 in

6 0
2 years ago
Both model building codes and NFPA __________ can be used to determine the type of construction used in a building.
Alex777 [14]

Answer:

Both model building codes and NFPA 220 can be used to determine the type of construction used in a building.

8 0
2 years ago
Compute the atomic density (the number of atoms per cm3 rather than mass density g/cm3) for a perfect crystal of silicon at room
Ann [662]

Answer:

5E22 atoms/cm³

Explanation:

We need to find the number of moles of silicon per cm³

number of moles per cm³ = density/atomic weight = 2.33 g/cm ÷ 28.09 g/mol = 0.083 mol/cm³.

Since there are 6.022 × 10²³ atoms/mol, then the number of atoms of silicon per cm³ = number of atoms per mol × number of moles per cm³

= 6.022 × 10²³ atoms/mol × 0.083 mol/cm³

= 0.4995 × 10²³ atoms/cm³

= 4.995 × 10²² atoms/cm³

≅ 5 × 10²² atoms/cm³

= 5E22 atoms/cm³

5 0
3 years ago
Other questions:
  • Which option is a potential environmental risk of adopting a new technology?
    5·1 answer
  • The vertical and horizontal poles at the traffic-light assembly are erected first. Determine the additional force and moment rea
    6·1 answer
  • Products that are in the process of being manufactured but are not yet complete are called:
    5·1 answer
  • Write a program to input 6 numbers. After each number is input, print the biggest of the numbers entered so far.
    12·1 answer
  • Exercise 5.46 computes the standard deviation of numbers. This exercise uses a different but equivalent formula to compute the s
    12·1 answer
  • In order to fill a tank of 1000 liter volume to a pressure of 10 atm at 298K, an 11.5Kg of the gas is required. How many moles o
    11·1 answer
  • For each of the resistors shown below, use Ohm's law to calculate the unknown quantity, Be sure to put your answer in proper eng
    8·1 answer
  • What does it mean to say that PEER is a data-driven, consumer-centric, and comprehensive system?
    8·2 answers
  • What speeds did john j montgomerys gliders reach
    12·1 answer
  • A complete mix of an activated sludge system without primary clarification is used for treatment of municipal wastewater with a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!