Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Beginning Visual C#
|
BOOK: Beginning Visual C#
This is the forum to discuss the Wrox book Beginning Visual C#, Revised Edition of Beginning C# for .NET v1.0 by Karli Watson, David Espinosa, Zach Greenvoss, Jacob Hammer Pedersen, Christian Nagel, Jon D. Reid, Matthew Reynolds, Morgan Skinner, Eric White; ISBN: 9780764543821
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 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 September 24th, 2004, 04:10 PM
Authorized User
 
Join Date: Jul 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning Visual C# Exercises - Chapter 06 Answers

1. Function signature expects a return value but example provides none
        Parameter array "args" must be last declared in argument list

2. if (args.Length >= 2)
        {
            string firstParam = args[0];
            int secondParam = Convert.ToInt32(args[1]);
            Console.WriteLine("Incoming arguments specify that {0} will occur {1} times.",
                firstParam, secondParam);
        }

3. delegate string inputDelegate();
        static string reader()
        {
            return Console.ReadLine();
        }

        .... on to Main()

        inputDelegate getInput;
        Console.WriteLine("Enter your name:");
        getInput = new inputDelegate(reader);
        Console.WriteLine("Result: {0}", getInput());

4. struct order
        {
            public string itemName;
            public int unitCount;
            public double unitCost;

            public double howMuch()
            {
                return unitCount * unitCost;
            }

5. public string orderInfo()
            {
                string badNews = "Order Information: " + Convert.ToString(unitCount) +
                    " " + itemName + " items at $" + Convert.ToString(unitCost) +
                    " each, total cost $" + Convert.ToString(howMuch());
                return badNews;
            }
        }





Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning Visual C# Exercises - Chapter 06 seblake C# 1 July 19th, 2004 09:15 AM





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