1 answer

1_ What is the output? private void btnMethods_Click(object sender, EventArgs e) { int arg1 = 2;...

Question:

1_ What is the output?

private void btnMethods_Click(object sender, EventArgs e)

{

int arg1 = 2;

double val = ValReturnMethod(arg1, 2.00);

MessageBox.Show(val.ToString());

}

private void ValReturnMethod(int val, double val2)

{

return val1 * val2 *25.50;

}

_____________________________

2_ What is the output?

private void btnMethods_Click(object sender, EventArgs e)

{

int arg1 = 4;

double val = ValReturnMethod(ref arg1);

MessageBox.Show(arg1.ToString());

}

private double ValReturnMethod(ref int val1)

{

return val1 *25.50;

}

______________________________

3_ What is the output?

private void btnMethods_Click(object sender, EventArgs e)

{

int arg1 = 4;

double arg2 = 10.50;

MessageBox.Show(ValReturnMethod(arg1,arg2).ToString());

}

private double ValReturnMthod (int val1,double val2)

{

return val1 * 25.50;

}

___________________________

This is not C++ it is Visual C#


Answers

1_ What is the output?

Answer: Code will not compile because we dont have return type in method header private void ValReturnMethod(int val, double val2)

it should be private doubleValReturnMethod(int val, double val2)

2_ What is the output?

Answer: 102

Since we are passing arg1 value as reference. The changes happend on that variable in function will reflect in actual copy of that variable. So arg1 value will display as 102.

3_ What is the output?

Answer: 102

Though w are passing arg1 and arg2 values, but we are suing arg1 value for calculation so arg1 value is 4 here.

4 * 25.50 = 102.

.

Similar Solved Questions

1 answer
Question 13 An object is located at a distance of 7.00 cm from a thin lens...
Question 13 An object is located at a distance of 7.00 cm from a thin lens with a radius of curvature of 66.0 mm. The image of the object is Inverted. Is the image real or virtual, and how far is the image from the lens? Real, 6.24 cm Virtual, 6.24 cm Real, 116 cm O Virtual, 116 cm Real, 2.2 cm...
1 answer
915mm 4. Two snooker balls are at rest when they are struck simul- taneously, rolling along...
915mm 4. Two snooker balls are at rest when they are struck simul- taneously, rolling along the paths AC and BC with the ve- locities shown. (1) Determine the angle that is required to cause the two balls to collide. Hint: consider what the relative motion vector needs to be. (ii) If the initial dis...
1 answer
Consider a centralized school choice problem with: • Four students, t_1.t_2.t_3, and t_4. • Four schools....
Consider a centralized school choice problem with: • Four students, t_1.t_2.t_3, and t_4. • Four schools. 5 1.5 2.5-3. and s_4. and • Each school having a single seat. The preferences of students are as follows Preferences >_j=3 >_j-2 11 $_1 $_2 53 5:1 52 51 t_4 $ 2 The prioriti...
1 answer
5. Two boxes are connected by a rope over a pulley. Box A is on a...
5. Two boxes are connected by a rope over a pulley. Box A is on a horizontal surface and box B hangs off vertically from the pulley at the edge of the surface A is on. Let the masses of these boxes be mA 5kg and m 2k9. Assume that the mass of the rope and the pulley, and the friction of the pulley i...
1 answer
Who discovered that the earth revolves around the sun and how was it proven?
Who discovered that the earth revolves around the sun and how was it proven?...
1 answer
---- --- m uuuca VIILUDLU 0I 2 .11 LICU UIC IIC OILY LIVU ILVCuIILLILL 8-3 in...
---- --- m uuuca VIILUDLU 0I 2 .11 LICU UIC IIC OILY LIVU ILVCuIILLILL 8-3 in her portfolio, what is her portfolio's beta? REQUIRED RATE OF RETURN Assume that the risk-free rate is 5.5% and the required return on the market is 12%. What is the required rate of return on a stock with a beta of 2?...
1 answer
7-14 please 8. what was sweeten company's cost of goods sold for March? 9. what were...
7-14 please 8. what was sweeten company's cost of goods sold for March? 9. what were the company's predetermined overhead rates in the Molding Department and the fabrication dept? 10. how much manufacturing overhead was applied from the molding department to job P and how much was applie...
1 answer
(1 point) Suppose h(x) = f(x) and the equation of the tangent line to f(x) at...
(1 point) Suppose h(x) = f(x) and the equation of the tangent line to f(x) at x = 1 Is y = 4+2(x - 1). Find h' (1) h'(1) =...
1 answer
QUESTION 23 Homeostasis refers to: realizing one's full potential. a balanced state in the body's internal...
QUESTION 23 Homeostasis refers to: realizing one's full potential. a balanced state in the body's internal environment. a state of optimum stimulation either above or below equilibrium. the mechanism by which unconscious needs are satisfied....
1 answer
OWO References apter 15: EOC stion 16 A solution is formed by mixing 50.0 mL of...
OWO References apter 15: EOC stion 16 A solution is formed by mixing 50.0 mL of 9.5 M/ NX with 50.0 ml. of 2.8 x 10-M CUNO, Assume that a forma complex ions with X as follows: stion 17 stion 18 stion 13 1 pt 1 pt pe tpt Cu (aq) +X-(e) CX(a) K -1.0 x 10' CX(g) + (aq) + Cux," () K -1.0 x 10...
1 answer
I need A through G DOOOOLLELLDE DEO DOPO DODUO DO (13%) Problem 12: Two parallel plates...
I need A through G DOOOOLLELLDE DEO DOPO DODUO DO (13%) Problem 12: Two parallel plates are charged with + and respectively as shown in the figure, where Q = 31 nC. The area of each plate is A = 0.021 m². The distance between them is d= 9.6 cm. The plates are in the air. Otheexpertta.co A 14% P...
1 answer
And with minitab please. 3. Perform a hypothesis test for H: Suz vs. H: > M2....
and with minitab please. 3. Perform a hypothesis test for H: Suz vs. H: > M2. The sample sizes are n = 10 and na = 15, sample means are X44.7 and that X2=53.8 and sample standard deviations are si = 11 and s2 = 6. Perform the test assuming variances are unequal. Use 5% significance....
1 answer
Pro Previous Problem (20 points) in general tor a non homogeneous problemy psy' +90) - )...
Pro Previous Problem (20 points) in general tor a non homogeneous problemy psy' +90) - ) assume that fundamental set of solutions for the homogeneous problemy ty + y - The formula for the particular solution using the method of variation of parameters is Y-7,41 + Y2 (101) W(1) where W(x) is the ...
1 answer
[The following information applies to the questions displayed below.] Delph Company uses a job-order costing system...
[The following information applies to the questions displayed below.] Delph Company uses a job-order costing system and has two manufacturing departments-Molding and Fabrication. The company provided the following estimates at the beginning of the year: Total Fabrication Molding 26,000 Machine-hours...
1 answer
A load of lumber of weight W 25 kN is being raised by a mobile crane. The weight of boom ABC and the combined weig...
A load of lumber of weight W 25 kN is being raised by a mobile crane. The weight of boom ABC and the combined weight of the truck and driver are as shown. Determine the reaction at each of the two (a) front wheels H, (b) rear wheels K. 0.6 m 0.4 m 0.3 m 3 kN 50 kN 2.0 m2.0 m 0.9 m 0.5 m...
1 answer
Can I please get help with the classification of the debentures. Saucy Ltd ("Saucy') is a...
Can I please get help with the classification of the debentures. Saucy Ltd ("Saucy') is a company listed on the JSE Ltd. The following information for the year ended 30 June 20.20 is available: Debentures On 1 January 20.20 Saucy bought 80 000 debentures for a total price of R6 480 000 and ...
1 answer
43. Which is a component of the endomembrane system? A. Nuclear membrane B. cristae C. outer...
43. Which is a component of the endomembrane system? A. Nuclear membrane B. cristae C. outer mitochondrial membrane D. thylakoid E.B,C,D 44. Rapidly growing cells accumulate water that is stored in vacuoles. Where is the excess water coming from? A. oxidation and dehydration synthesis reactions B. h...
1 answer
In a monopolistically competitive​ market, entry into the industry A. is blocked. B. is difficult due...
In a monopolistically competitive​ market, entry into the industry A. is blocked. B. is difficult due to extensive government regulation. C. is relatively easy. D. is as difficult as entry into a monopoly....
1 answer
Describe how fructose, non-nutritive and nutritive sweeteners could potentially disturb energy balance and cause obesity (consider...
describe how fructose, non-nutritive and nutritive sweeteners could potentially disturb energy balance and cause obesity (consider hormones that regulate food intake and metabolism-leptin, ghrin,insulin, etc.)...