Wrox Programmer Forums
|
BOOK: Beginning Visual C# 2012
This is the forum to discuss the Wrox book Beginning Visual C# 2012 by Karli Watson, Jacob Vibe Hammer, Jon Reid, Morgan Skinner, Daniel Kemper, Christian Nagel, ; ISBN: 978-1-118-31441-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2012 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 November 22nd, 2015, 09:34 PM
Authorized User
 
Join Date: Oct 2015
Posts: 58
Thanks: 3
Thanked 0 Times in 0 Posts
Default Ch4, p76, 4.2 - 3rd solution?

Hi, I think a 3rd possibility for the solution of Exercise 2 in Chapter 4 is:

Code:
static void Main(string[] args)
        {
            int num1, num2;
            bool areGreater = true;
            do{
                Console.WriteLine("Write one number");
                num1 = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Write another number");
                num2 = Convert.ToInt32(Console.ReadLine());
                if ((num1 > 10) || (num2 > 10))
                {
                    Console.WriteLine("Numbers should be lesser than 10");
                }
                else { areGreater = false; }

            } while (areGreater);   
            Console.WriteLine("{0} and {1} are lesser than 10",num1, num2 );
            Console.ReadKey();
        }
Interesting the Mandelbrot set example, it'll take more math mindset to decode it. Hah.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch4 MagicMind Glorysaber BOOK: Beginning iOS Game Development 3 March 17th, 2012 01:38 PM
Need help with Ch4 Exercise 3! xiao_mao_mimi BOOK: Ivor Horton's Beginning Java, Java 7 Edition 1 December 22nd, 2011 02:37 PM
Exercise 4, P76 - solution on p. 652 Jim.Clauson BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 5 March 4th, 2011 01:06 PM
Exercise 4, P76 - solution on p. 652 Jim.Clauson BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 0 October 15th, 2009 08:30 PM
Ch4 Problem daivos03 JSP Basics 9 January 30th, 2006 01:57 AM





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