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
iris [78.8K]
3 years ago
7

#include using namespace std; void PrintFactorial(int factCounter, int factValue){ int nextCounter; int nextValue; if (factCount

er == 0) { // Base case: 0! = 1 cout << "1" << endl; } else if (factCounter == 1) { // Base case: Print 1 and result cout << factCounter << " = " << factValue << endl; } else { // Recursive case cout << factCounter << " * "; nextCounter = factCounter - 1; nextValue = nextCounter * factValue; /* Your solution goes here */ } } int main() { int userVal; cin >> userVal; cout << userVal << "! = "; PrintFactorial(userVal, userVal); return 0; }

Engineering
1 answer:
bazaltina [42]3 years ago
8 0

Answer:

Check the explanation

Explanation:

Code in C++::

#include <iostream>

using namespace std;

void PrintFactorial(int factCounter, int factValue){

int nextCounter = 0;

int nextValue = 0;

if (factCounter == 0) { // Base case: 0! = 1

cout << "1" << endl;

}

else if (factCounter == 1) { // Base case: Print 1 and result

cout << factCounter << " = " << factValue << endl;

}

else { // Recursive case

cout << factCounter << " * ";

nextCounter = factCounter - 1;

nextValue = nextCounter * factValue;

/* Your solution goes here */

/**

* We just need to call the function PrintFactorial() recursively

* and pass the two parameters that are just calculated as nextCounter for factCounter

* and nextValue as factValue.

*/

PrintFactorial(nextCounter,nextValue);

}

}

int main() {

int userVal = 0;

userVal = 5;

cout << userVal << "! = ";

PrintFactorial(userVal, userVal);

return 0;

}

Output::

Test Case 1 where userVal=5::

<em><u>Attached Image 1</u></em>

Test Case 2 where userVal=6::

<em><u>Attached Image 1</u></em>

You might be interested in
What is the magnitude of the maximum stress that exists at the tip of an internal crack having a radius of curvature of 2.5×10-4
krok68 [10]

Answer:

1788.9 MPa

Explanation:

The magnitude of the maximum stress (σ) can be calculated usign the following equation:

\sigma = 2\sigma_{0} \sqrt{\frac{a}{\rho}}

<u>Where:</u>

<em>ρ: is the radius of curvature = 2.5x10⁻⁴ mm (0.9843x10⁻⁵ in)</em>

<em>σ₀: is the tensile stress = 100x10⁶ Pa (14500 psi) </em>

<em>2a: is the crack length = 4x10⁻² mm (1.575x10⁻³ in) </em>

Hence, the  maximum stress (σ) is:

\sigma = 2*100\cdot 10^{6} Pa \sqrt{\frac{(4 \cdot 10^{-2} mm)/2}{2.5 \cdot 10^{-4} mm}} = 1.79 \cdot 10^{6} Pa = 1788.9 MPa    

Therefore, the magnitude of the maximum stress is 1788.9 MPa.

I hope it helps you!

5 0
3 years ago
You just purchased a 400-L rigid tank for a client who works in the gas industry. The tank is delivered pre-filled with 3 kg of
solniwko [45]

Answer:

the pressure reading when connected a pressure gauge is 543.44 kPa

Explanation:

Given data

tank volume (V) = 400 L i.e 0.4 m³

temperature (T) =  25°C  i.e. 25°C + 273 = 298 K

air mass (m)  = 3 kg

atmospheric pressure  = 98 kPa

To find out

pressure reading

Solution

we have find out pressure reading by gauge pressure

i.e. gauge pressure = absolute pressure - atmospheric pressure

first we find absolute pressure (p) by the ideal gas condition

i.e pV = mRT

p = mRT / V

p = ( 3 × 0.287 × 298 ) / 0.4

p = 641.44 kPa

so

gauge pressure = absolute pressure - atmospheric pressure

gauge pressure = 641.44 - 98

gauge pressure = 543.44 kPa

6 0
2 years ago
How high of a column of sae 30 oil would be required to give the same pressure as 700 mm hg?
Rasek [7]

Hoiu-10,4000 mm.

<h3>Is positive pressure good for PC?</h3>
  • A balanced configuration is the most efficient way to cool your pc although it should tend towards a slight positive pressure if you can help it.
  • Tip: As much as it might seem important, the concept of heat rising doesn't have too much of an effect.

To learn more about it, refer

to https://brainly.in/question/413163

#SPJ4

7 0
1 year ago
What is Pressure measured from absolute zero pressure called?
7nadin3 [17]
Anything greater than total vacuum is technically a form of pressure
5 0
3 years ago
A cylindrical insulation for a steam pipe has an inside radius rt = 6 cm, outside radius r0 = 8 cm, and a thermal conductivity k
goldfiish [28.3K]

Answer:

heat loss per 1-m length of this insulation is 4368.145 W

Explanation:

given data

inside radius r1 = 6 cm

outside radius r2 = 8 cm

thermal conductivity k = 0.5 W/m°C

inside temperature t1 = 430°C

outside temperature t2 = 30°C

to find out

Determine the heat loss per 1-m length of this insulation

solution

we know thermal resistance formula for cylinder that is express as

Rth = \frac{ln\frac{r2}{r1}}{2 \pi *k * L}   .................1

here r1 is inside radius and r2 is outside radius L is length and k is thermal conductivity

so

heat loss is change in temperature divide thermal resistance

Q = \frac{t1- t2}{\frac{ln\frac{r2}{r1}}{2 \pi *k * L}}

Q = \frac{(430-30)*(2 \pi * 0.5 * 1}{ln\frac{8}{6} }

Q = 4368.145 W

so heat loss per 1-m length of this insulation is 4368.145 W

4 0
3 years ago
Other questions:
  • Use the APWA 5600 methodology to compute the 1/25 design discharge for the following catchment. The catchment area consists of 1
    9·1 answer
  • Write a function called pyramid(height) that acceptsa parameter ""height"". It then prints a pyramid of that height
    10·1 answer
  • An object at a vertical elevation of 20 m and a speed of 5 m/s decreases in elevation to an elevation of 1 m. At this location,
    15·1 answer
  • Calculate the number of vacancies per cubic meter for some metal, M, at 749°C. The energy for vacancy formation is 0.86 eV/atom,
    5·1 answer
  • Carbon dioxide (CO2) expands isothermally at steady state with no irreversibilities through a turbine from 10 bar, 500 K to 2 ba
    15·1 answer
  • As an engineer which types of ethical issues or problem you can face in industrial environment.
    8·1 answer
  • A Carnot heat engine absorbs 235 KW of heat from a heat source and rejects 164 KW to the atmosphere. Determine the thermal effic
    7·1 answer
  • A tiger cub has a pattern of stripes on it for that is similar to that of his parents where are the instructions stored that pro
    8·1 answer
  • What happens if you leave your car on while pumping gas
    8·1 answer
  • Explain race condition..<br><br>don't spam..​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!