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
After a 65 newton weight has fallen freely from rest a vertical distance of 5.3 meters, the kinetic energy of the weight is
inysia [295]

Answer:

The kinetic energy of the weight is 344.5 J

Explanation:

Given that:

Force = F = 65 newton

distance = d = 5.3 meters

We have to find change in kinetic energy ΔK.E

Now we know that, initially kinetic energy was 0 So the formula we use will be:

Work done = Change in kinetic energy

Mathematically,

W =  ΔK.E

As we know W = F . d and  ΔK.E = K.E(final) - K.E(initial)

So by putting values:

F . d = K.E(final) - K.E(initial)

F . d = K.E(final)

As  K.E(initial) is 0 so by putting values of F and d

(65)* (5.3) =  K.E(final)

344.5 J =  K.E(final)

So the change in  K.E will also be 344.5 J

i hope it will help you!

3 0
3 years ago
In a heat-treating process, a 1-kg metal part, initially at 1075 K, is quenched in a closed tank containing 100 kg of water, ini
storchak [24]

Answer:

attached below

Explanation:

8 0
3 years ago
A skull and crossbones pictogram indicates this kind of information about a chemical.
Oliga [24]

Answer:

This pictogram indicates that the chemical is toxic and dangerous.

Explanation:

3 0
3 years ago
To make 1000 containers of ice cream you need: 600 gallons of milk, 275 gallons of cream, and 120 gallons of flavor. Each ingred
Kamila [148]

Answer:

For the cream, 32 gallons should be reduced and 12 gallons should be decreased for flavor.

Explanation:

To prepare a total of 1000 gallons of ice cream you need 600 gallons of milk, 275 gallons of cream and 120 gallons of flavor, therefore we must calculate the percentages of each ingredient, as follows:

%milk=(600/1000)x100=60%

%cream=(275/1000)x100=27.5%

%flavor=(120/1000)x100=12%

If you reduce the amount of milk by 10% you have:

Milk quantity=600 gallons-(600x0.1)=540 gallons

To maintain the same percentages of each ingredient, you must make a rule of three to know the amount of cream and flavor that would need to be used with the 540 gallons of milk. The rule of three is as follows:

540 gallons of milk------------------60%

x gallons of cream--------------------27.5%

Clearing the x:

x gallons of cream=(540x27.5)/60=243 gallons

In the same way for flavor:

540 gallons of milk------------------60%

x gallons of flavor--------------------12%

Clearing the x:

x gallons of flavor=(540x12)/60=108 gallons

Verifying that they meet the percentages that were calculated before:

Total amount of ice cream=540+243+108=891 gallons

Calculate the percentages of each ingredient:

%milk=(540/891)x100=60.6%

%cream=(243/891)x100=27.3%

%flavor=(108/891)x100=12.1%

As can be seen, it is found that approximately the same percentages calculated above are met. Therefore, we can already calculate the amount by which the cream should be reduced and the flavor.

For the cream:

Gallons of cream=275-243=32 gallons

For the flavor:

Gallons of flavor=120-108=12 gallons

3 0
3 years ago
An article gave a scatter plot along with the least squares line of x = rainfall volume (m3) and y = runoff volume (m3) for a pa
kompoz [17]

Answer:

y = 0.834X - 1.58015

Slope = 0.8340 ; Intercept = - 1.5802

y = 40.9539

19.93

0.9765

Explanation:

X: Rainfall volume

6

12

14

16

23

30

40

52

55

67

72

81

96

112

127

Y : Runoff

4

10

13

14

15

25

27

48

38

46

53

72

82

99

100

The scatterplot shows a reasonable linear trend between the Rainfall volume and run off.

The estimated regression equation obtained using a linear regression calculator is :

y = 0.834X - 1.58015

y = Runoff ; x = Rainfall volume

Slope = 0.8340 ; Intercept = - 1.5802

Point estimate for Runoff, when, x = 51

y = 0.834X - 1.58015

y = 0.834(51) - 1.58015

y = 40.95385

y = 40.9539

d.)

Point estimate for standard deviation :

s = 5.145

σ = s * √n

σ = √15 * 5.145

= 19.93

e.)

r² = Coefficient of determination gives the proportion of explained variance in Runoff due to the regression line. From the model output, the r² value = 0.9765. Which means That about 97.65% Runoff is due to Rainfall volume.

7 0
3 years ago
Other questions:
  • A petrol engine produces 20 hp using 35 kW of heat transfer from burning fuel. What is its thermal efficiency, and how much powe
    14·1 answer
  • Explain what entropy is in relation to the second law of thermodynamics?
    9·1 answer
  • A surveyor is trying to find the height of a hill . he/she takes a sight on the top of the hill and find that the angle of eleva
    12·1 answer
  • Which of the code pieces below should replace the underline?public class Test{public static void main(String[] args){Test test =
    8·1 answer
  • ). A company periodically tests its product for tread wear under simulated conditions. Thirty random samples, each containing 5
    11·1 answer
  • The two pond system is fed by a stream with flow rate 1.0 MGD (million gallons per day) and BOD (nonconservative pollutant) conc
    15·1 answer
  • Which one is dependent variable?
    13·1 answer
  • An ocean thermal energy conversion system is being proposed for electric power generation. Such a system is based on the standar
    5·1 answer
  • Which work practice should be followed to best prevent the ingestion of chemicals?
    7·1 answer
  • Global climate and weather patterns are driven by differences in the amount of heat energy in different areas of the earth. Whic
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!