Wrox Programmer Forums
|
BOOK: Beginning Visual C# 2010
This is the forum to discuss the Wrox book Beginning Visual C# 2010 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, ; ISBN: 9780470502266
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2010 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2011, 11:03 PM
Registered User
 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Chapter 19 Exercise 4

Hello!

When I try to write this part:

else
{
int row;
int seat;
GetNextFreeSeat(out row, out seat);
resp.Row = row;
resp.Seat = seat;
}

The GetNextFreeSeat method is not defined in the context.
Somebody can help me with this?

Thanks in Advance.
 
Old July 23rd, 2011, 11:53 AM
Wrox Author
 
Join Date: Sep 2010
Posts: 175
Thanks: 3
Thanked 53 Times in 53 Posts
Default

All this should be part of excercise 3, the implementation of the service.
GetNextFreeSeat could look like this:
Code:
        private void GetNextFreeSeat(out int row, out int seat)
        {
            row = -1;
            seat = -1;
            for (int r = 0; r < maxRows; r++)
            {
                for (int s = 0; s < maxSeats; s++)
                {
                    if (!this.reservedSeats[r, s])
                    {
                        row = r;
                        seat = s;
                        return;
                    }

                }
            }
        }
Hope this helps.
__________________
Christian
CN innovation
Visit my blog at: csharp.christiannagel.com
Follow me on twitter: @christiannagel





Similar Threads
Thread Thread Starter Forum Replies Last Post
Lesson 19 Exercise 4 mpthemaster BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 3 June 11th, 2011 08:54 PM
Chapter 19 johanyu BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 3 November 12th, 2007 10:50 AM
Chapter 19 Exercise CharlieChan BOOK: Beginning Visual C++ 6 0 June 19th, 2005 05:15 PM
Chapter 19 johanyu BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 2 October 10th, 2004 11:30 PM
Problem with exercise in chapter 19 backslash BOOK: Beginning Visual C++ 6 4 September 5th, 2003 11:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.