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
Nikolay [14]
4 years ago
14

Write the definition of a function printLarger, which has two int parameters and returns nothing. The function prints the larger

value of the two parameters to standard output on a single line by itself.
Engineering
1 answer:
vredina [299]4 years ago
7 0

Answer:

  1. #include <iostream>
  2. using namespace std;
  3. void printLarger(int a, int b){
  4.    
  5.    if(a > b){
  6.        cout<<a;
  7.    }else{
  8.        cout<<b;
  9.    }
  10. }
  11. int main()
  12. {
  13.    printLarger(4, 5);
  14.    return 0;
  15. }

Explanation:

The solution code is written in C++.

Firstly define a function printLarger that has two parameters, a and b with both of them are integer type (Line 5). In the function, create an if condition to check if a bigger than b, print a to terminal (Line 7-8). Otherwise print b (Line 9-10).

In the main program, test the function by passing 4 and 5 as arguments (Line 16) and we shall get 5 printed.  

You might be interested in
What flight patterns do groups of birds utilize and why?
lara31 [8.8K]
Birds mostly fly in a V because the lead bird cuts al of the wind and has the hardest work and then after a while the lead bird goes to the back and another bird takes his place cutting all the wind for the other birds
7 0
3 years ago
Oil with a density of 800 kg/m3 is pumped from a pressure of 0.6 bar to a pressure of 1.4 bar, and the outlet is 3 m above the i
Naddik [55]

Answer:

23.3808 kW

20.7088 kW

Explanation:

ρ = Density of oil = 800 kg/m³

P₁ = Initial Pressure = 0.6 bar

P₂ = Final Pressure = 1.4 bar

Q = Volumetric flow rate = 0.2 m³/s

A₁ = Area of inlet = 0.06 m²

A₂ = Area of outlet = 0.03 m²

Velocity through inlet = V₁ = Q/A₁ = 0.2/0.06 = 3.33 m/s

Velocity through outlet = V₂ = Q/A₂ = 0.2/0.03 = 6.67 m/s

Height between inlet and outlet = z₂ - z₁ = 3m

Temperature to remains constant and neglecting any heat transfer we use Bernoulli's equation

\frac {P_1}{\rho g}+\frac{V_1^2}{2g}+z_1+h=\frac {P_2}{\rho g}+\frac{V_2^2}{2g}+z_2\\\Rightarrow h=\frac{P_2-P_1}{\rho g}+\frac{V_2^2-V_1^2}{2g}+z_2-z_1\\\Rightarrow h=\frac{(1.4-0.6)\times 10^5}{800\times 9.81}+\frac{6.67_2^2-3.33^2}{2\times 9.81}+3\\\Rightarrow h=14.896\ m

Work done by pump

W_{p}=\rho gQh\\\Rightarrow W_{p}=800\times 9.81\times 0.2\times 14.896\\\Rightarrow W_{p}=23380.8\ W

∴ Power input to the pump 23.3808 kW

Now neglecting kinetic energy

h=\frac{P_2-P_1}{\rho g}+z_2-z_1\\\Righarrow h=\frac{(1.4-0.6)\times 10^5}{800\times 9.81}+3\\\Righarrow h=13.19\ m\\

Work done by pump

W_{p}=\rho gQh\\\Rightarrow W_{p}=800\times 9.81\times 0.2\times 13.193\\\Rightarrow W_{p}=20708.8\ W

∴ Power input to the pump 20.7088 kW

6 0
3 years ago
On aircraft equipped with fuel pumps, when is the auxiliary electric driven pump used?.
pochemuha
In an airplane equipped with fuel pumps, the auxiliary electric fuel pump is used in the event the engine-driven fuel pump fails.. hope this helped !
6 0
2 years ago
Distinguish between systems analysis and systems design?
Zielflug [23.3K]

Answer:

System analysis can be defined as a deep analysis of a part of the structure of a module that has been designed before. System design means to make any module or a part of the structure from scratch and build it completely without estimation.

Explanation:

3 0
3 years ago
Economics is the study of how individuals and societies make choices under the condition of
k0ka [10]

Answer:

ig scarcity

Explanation:

Hope it Helps!!!

3 0
2 years ago
Other questions:
  • A cylindrical tank is required to contain a gage pressure 520 kPa . The tank is to be made of A516 grade 60 steel with a maximum
    6·1 answer
  • The input power for a thermostat is wired to the
    8·1 answer
  • During a long run a very well-trained dog can use up to 1000 ‘cal’/hour (Note: Food calories differ by a factor of one thousand
    14·1 answer
  • a poorly tighten terminal is often the cause of a/an ? a) open circuit b) circuit breaker interrupt c)short circuit d) ground fa
    10·1 answer
  • Find all the words, Figure out my puzzle!
    14·2 answers
  • Difference between theory and practice?​
    10·1 answer
  • It is better to know or not to know?​
    6·2 answers
  • Welding and cutting done in confined spaces must
    5·2 answers
  • A school is playing $0.XY per kWh for electric power. To reduce its power bill, the school installs a wind turbine with a rated
    6·1 answer
  • You installed a new 40 gallon water heater with a 54,000 BTUh burner. The underground water temperature coming into the house is
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!