O'Reilly logo

Visual C#® 2012: How to Program, Fifth Edition by Harvey Deitel, Paul Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.4. Declaring Methods with Multiple Parameters

We now consider how to write your own methods with multiple parameters. The app in Fig. 7.3 uses a user-defined method called Maximum to determine and return the largest of three double values. When the app begins execution, the Main method (lines 8–22) executes. Line 18 calls method Maximum (declared in lines 25–38) to determine and return the largest of the three double values. At the end of this section, we’ll discuss the use of operator + in line 21.

 1   // Fig. 7.3: MaximumFinder.cs  2   // User-defined method Maximum.  3   using System;  4  5   public class MaximumFinder  6   {  7      // obtain three floating-point values and determine maximum value  8       ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required