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
To ensure that a vehicle crash is inelastic, vehicle safety designers add crumple zones to vehicles. A crumple zone is a part of
spin [16.1K]

Answer:

Explanation:

Answer: With crumple zones at the front and back of most cars, they absorb much of the energy (and force) in a crash by folding in on itself much like an accordion. ... As Newton's second law explains force = Mass x Acceleration this delay reduces the force that drivers and passengers feel in a crash.Sep 30, 2020

5 0
3 years ago
Your manager has asked you to research and recommend a writing guide that examiners in your digital forensics company can use fo
vivado [14]

Answer:

Kindly Check the explanation

Explanation:

Report

A Report is a way to present the forensic examination result in front of judge. A report contains warrants, all affidavits issued for arrest, expenses occur during forensic test and lists of evidence. Apart from evidence a report also contains expert opinions.  

Guidelines  

These are the set of rules and written statement which are used to present the important information in a structured and clear format. The main motive behind to define the guidelines is to achieve standardization in the reports. It also improves the readability of the report.  

Guidelines for report  

Abstract:  

Each report must contain an abstract of the report which gives the brief review about the report. It came at the starting of the report. The main motive behind to give abstract is to give brief about report to someone in a very less time. The size of abstract must not be more than one page.  

Index:  

Each report must contain an index which display's which content is available at which page of report. The content of index must be appropriate and clear so that the reader will not get confuse.

Format of report:

The formatting of report is also one of the essential parts of the guidelines. It makes the report attractive and also due to this reader not gets bored while reading the report. The guidelines regarding layout of report are as follow:  

1. Use time roman font and 12 font size as a default font to explain anything in the report.  

2. The explanation must be justified

3. As possible divide the long paragraph. if possible explain in points.

4. The page must have border on all sides

5. Each pages must have numbering and footer

Rules for grammar:

1. The language of the report must be simple and clear. So that everyone can understand it easily.

2. Avoid repeating same sentence or word again and again.

3. Use active instead of passive voice, in order to give importance to doer.

4. Write expressions between commas.

5. Avoid spelling mistakes in report which also make wrong impact.

6. As possible give heading or subheading to material or explanation which must be accurate.

7. Explain, new or difficult words used in the report.

8. What ever written in the report must be through the point and accurate on bases of fact.

Body of report:

The body of the report referred to as a content written inside the report. In order to write an impressive report, it must include all these things:

1. Avoid use of hypothetical question, if still hypothetical question arises it must be bases on factual evidence.  

2. Add all the affidavits and warrants in the report issued for search and arrest.

3. The cost money expenses while solving the case.

4. The expert opinion which must be bases on knowledge or previously declare case results.

5. The list of people and evidence which are collected and interrogative during the investigation.

6. If investigation is further going on than write the area in which the investigation further goes on and also mention when the investigation get complete.  

Forensic software used:  

A short must be given about the software used in the investigation. The result generated by the software must also be pasted in that report. It is more good if attach the snap shot of the result. Add any previous case result in which the same software result is taken as evidence, in order to justify that the result generated by the software is true. Some of forensic softwares are FTK, ProDiscover, Hexworkshop. The result of these softwares must be heighted so that everyone can notice it.  

Conclusion:  

The conclusion must be given at the end of report to tell according him what result came after investigation. In conclusion also write on which basis the result concludes. There must be strong behind the conclusion.  

References:  

In Reference write all the cases, thesis, books which an investigator followed to solve the current case. In addition if they referred any internet article. They can also write the website name where  that article lies. In short can say that write everything where they got an idea which is helpful in solving the case.

 

8 0
3 years ago
You are designing the access control policies for a Web-based retail store. Customers access the store via the Web, browse produ
PolarNik [594]

Answer:

Object-Oriented Software Engineering Using UML, Patterns, and Java, 3e, shows readers how to use both the principles of software engineering and the practices of various object-oriented tools, processes, and products.

3 0
2 years ago
A hawser is wrapped two full turns around a bollard. By exerting an 80-lb force on the free end of the hawser, a dockworker can
Brut [27]

Answer:

μ=0.329, 2.671 turns.

Explanation:

(a)   ln(T2/T1)=μβ         β=angle of contact in radians

take T2 as greater tension value and T1 smaller, otherwise the friction would be opposite.

T2=5000 lb and T1=80 lb

we have two full turns which makes total angle of contact=4π  radians

μ=ln(T2/T1)/β=(ln(5000/80))/4π  

μ=0.329

(b) using the same relation as above we will now compute the angle of contact.

take greater tension as T2 and smaller as T1.

T2=20000 lb     T1=80 lb   μ=0.329

β=ln(20000/80)/0.329=16.7825 radians

divide the angle of contact by 2π to obtain number of turns.

16.7825/2π =2.671 turns

4 0
3 years ago
An ideal gas initially at 300 K and 1 bar undergoes a three-step mechanically reversible cycle in a closed system. In step 12, p
Veseljchak [2.6K]

Answer:

Ts =Ta E)- 300(

569.5 K

5

Q12-W12 = -4014.26

Mol

AU2s = Q23= 5601.55

Mol

AUs¡ = Ws¡ = -5601.55

Explanation:

A clear details for the question is also attached.

(b) The P,V and T for state 1,2 and 3

P =1 bar Ti = 300 K and Vi from ideal gas Vi=

10

24.9x10 m

=

P-5 bar

Due to step 12 is isothermal: T1 = T2= 300 K and

VVi24.9 x 10x-4.9 x 10-3 *

The values at 3 calclated by Uing step 3l Adiabatic process

B-P ()

Since step 23 is Isochoric: Va =Vs= 4.99 m* and 7=

14

Ps-1x(4.99 x 103

P-1x(29x 10)

9.49 barr

And Ts =Ta E)- 300(

569.5 K

5

(c) For step 12: Isothermal, Since AT = 0 then AH12 = AU12 = 0 and

Work done for Isotermal process define as

8.314 x 300 In =4014.26

Wi2= RTi ln

mol

And fromn first law of thermodynamic

AU12= W12 +Q12

Q12-W12 = -4014.26

Mol

F'or step 23 Isochoric: AV = 0 Since volume change is zero W23= 0 and

Alls = Cp(L3-12)=5 x 8.311 (569.5 - 300) = 7812.18-

AU23= C (13-72) =5 x 8.314 (569.3 - 300) = 5601.53

Inol

Now from first law of thermodynamic the Q23

AU2s = Q23= 5601.55

Mol

For step 3-1 Adiabatic: Since in this process no heat transfer occur Q31= 0

and

AH

C,(T -Ts)=x 8.314 (300- 569.5)= -7842.18

mol

AU=C, (T¡-T)= x 8.314 (300

-5601.55

569.5)

mol

Now from first law of thermodynamie the Ws1

J

mol

AUs¡ = Ws¡ = -5601.55

3 0
3 years ago
Other questions:
  • The temperature of a flowing gas is to be measured with a thermocouple junction and wire stretched between two legs of a sting,
    8·1 answer
  • A turbine produces shaft power from a gas that enters the turbine with a (static) temperature of 628 K, a velocity of 143 m/s an
    7·1 answer
  • The head difference between the inlet and outlet of a 1km long pipe discharging 0.1 m^3/s of water is 0.53 m. If the diameter is
    11·1 answer
  • Psychologist who uses behavioral approach to therapy would probably try which of the following
    13·2 answers
  • Chemical materials that are transported are called..
    8·1 answer
  • Assess the capabilities of a hydroelectric power plant from the following field data: Estimated water flow rate, 40 m3/s River i
    9·1 answer
  • Kim is working on the cost estimate and feasible design options for a building. Which stage of a construction plan is Kim workin
    5·1 answer
  • Explain the underlying physical reason why when we conduct various heat treatments on 1018 steel we expect the modulus of elasti
    8·1 answer
  • Different metabolic control systems have different characteristic time scales for a control response to be achieved. Match the t
    6·1 answer
  • 3. Aqueous cleaners are
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!