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
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
Water at 20 °C is flowing with velocity of 0.5 m/s between two parallel flat plates placed 1 cm apart. Determine the distances f
Basile [38]

Answer:

The distance from the entrance at which the boundary layers meet is 0.516m

The distance from the entrance at which the thermal boundary layers meet is 1.89m

Explanation:

For explanation, look at the attached file

3 0
3 years ago
Free ideas free points. You will be reported for answering "no" or I don't know
KengaRu [80]

Answer:

Here are some cool ideas that you could do

-Zero fuel aircraft

-Advanced Space Propulsion Technologies

-Smart Automation and Blockchain

These are some things I've been working on for a few years lol, maybe you will have more luck

5 0
3 years ago
A gas mixture containing 3 moles CO2, 5 moles H2 and 1 mole water is undergoing the following reactions CO2+3H2 →cH3OH + H2O Dev
Ilya [14]
Aaaaaaaaaaaaaaaaaaaaaa
7 0
3 years ago
Pls help me it’s due today
hichkok12 [17]

Answer:

C. 14.55

Explanation:

12 x 10 = 120

120 divded by 10 is 12

so now we do the left side

7 x 3 = 21 divded by 10 is 2

so now we have 14

and the remaning area is 0.55

so 14.55

6 0
3 years ago
Other questions:
  • The flow curve for a certain metal has parameters: strain-hardening
    8·1 answer
  • Name the main classes of polymer and define their characteristic properties
    15·1 answer
  • What is the function of engineering
    6·1 answer
  • 1. Using the formula above, complete this task.
    9·1 answer
  • using the two transistor analogy to explain what happens when an SCR is supplied with some gate current.​
    15·1 answer
  • What are the environmental factors that cause the formation of rust?
    7·1 answer
  • It's in the picture please asap
    6·2 answers
  • What building codes did Mega Corporation fail to follow?
    9·1 answer
  • What is the process pf distributing and selling clean fuel?​
    6·1 answer
  • By the end of the day, a 45 ft x 25 ft x 8 ft office has a carbon dioxide air level of 1,100 ppm. Determine the time in hours ne
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!