Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

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

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;
            }
        }
 
Old July 19th, 2004, 09:15 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Is there a question associated with this post?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning Visual C# Exercises - Chapter 18 seblake C# 1 October 9th, 2004 11:33 PM
Beginning Visual C# Exercises - Chapter 15 seblake C# 1 September 17th, 2004 08:41 PM
Beginning Visual C# Exercises - Chapter 14 seblake C# 0 September 8th, 2004 06:19 PM
Beginning Visual C# Exercises - Chapter 12 seblake C# 1 August 21st, 2004 02:55 PM





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