Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Visual Studio c# - Passing data to and from function/method 1. Create a new project called PassingData. The GUI should have 4 textboxes, 4 labels(one

Visual Studio c# - Passing data to and from function/method

1. Create a new project called PassingData. The GUI should have 4 textboxes, 4 labels(one label for each textbox), and 3 Buttons. The 4 labels should say num1, num2, num3 and answer. The 3 Buttons should say Return Value, Global Data and Pass-by-Reference.

2. You are to build a max() function that takes 3 arguments(the data from the num1, num2 and num3 textboxes) and returns the maximum of the 3 values passed in. But you really have to build 3 different functions that figure the max value. The first maxReturn() of the 3 functions will pass the answer back to the calling routine using the return value of the function. The second function maxGlobal() will use global data to pass the answer back to the calling function. And the third function maxRef(), will use pass-by-reference to pass the answer back to the calling function. These 3 functions will not pull the data out of the textboxes, or put the answer in the answer textbox, the functions will only calculate the max and send the data back to the calling function.

3. Now add the event code behind each Button. In the Button Click event for each of the 3 buttons, you should pull the data out of the 3 textboxes for num1, num2 and num3. Then call the function to figure out the max. Lastly get the answer back from the function, and put the answer in the answer textbox.

All 3 functions will do the same calculation, the difference is that each function will pass the answer back to the calling function in a different manner.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions