Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning C# 6.0 Programming with Visual Studio 2015
This is the forum to discuss the Wrox book Beginning C# 6.0 Programming with Visual Studio 2015 by Benjamin Perkins, Jacob Vibe Hammer, Jon D. Reid; ISBN: 978-1-119-09668-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning C# 6.0 Programming with Visual Studio 2015 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
  #1 (permalink)  
Old January 28th, 2016, 01:40 AM
Authorized User
Points: 129, Level: 2
Points: 129, Level: 2 Points: 129, Level: 2 Points: 129, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2016
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Chapter03

After reading the third chapter, I feel like a cherry dipped in molten chocolate. I mean it might take some time to soak up all the information, but the authors gave it all. Thanks guys.

Cruisin... through.
  #2 (permalink)  
Old February 13th, 2016, 03:02 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Errata - code error on page 155

I didn't see the errata posting area for this book so I thought I would post it here.

The code on p. 155 ...

Code:
int i = 1;
do
{
   WriteLine("{0}", i++);
} while (i <= 10);
should be ....

Code:
int i = 1;
 do
 {
    WriteLine($"{i}", i++);
} while (i < 10);
  #3 (permalink)  
Old February 14th, 2016, 07:17 PM
Authorized User
Points: 129, Level: 2
Points: 129, Level: 2 Points: 129, Level: 2 Points: 129, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2016
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb No problem with the code!

First of all the code that you mentioned is in page 67 of my printed version of the book. Weird??? I don't see any problem with the code you mentioned either. The authors are trying to explain how the do...while loop works. The code in the book prints numbers 1 to 10 like it is supposed to.

If you are confused by the use of "{0}", i++ instead of $"{i}",i++ then both of these are valid C# code. Use of $"{i}",i++ being the latest C# 6.0 feature.

Try copying the code within -------- in visual studio and try it out.
-------------------------------------------------------------------------------
using System;

namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
int i = 1;
do
{
Console.WriteLine("{0}",i++);
} while(i <= 10);

Console.ReadKey();
}
}
}
----------------------------------------------------------------------------------
// Prints out
1
2
3
4
5
6
7
8
9
10

Hope this helps you understand how do...while loop works!
  #4 (permalink)  
Old October 8th, 2016, 12:03 AM
Registered User
Points: 36, Level: 1
Points: 36, Level: 1 Points: 36, Level: 1 Points: 36, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2015
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Default Ch. 3 Exercises

Hi all, I think the answer in the appendix to exercise 3.5 is incorrect.
Question:
By considering operator precedence, list the steps involved in the computation of the following expression:
resultVar += var1 * var2 + var3 % var4 / var5;

The precedence shown using parentheses in Appendix A is:
resultVar += (((var1 * var2) + var3) % (var4 / var5));

I believe the answer should be:
resultVar + ((var1 * var 2) + ((var3 % var4) / var5))

To me it seems as though the answer in the appendix gives preference to an addition operation over the % operation which is incorrect. It's late at night so I might just be sleepy, but feel free to take a look.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter03 - Putting Objects to Work Peter0702 BOOK: Professional PHP 5 ISBN: 978-0-7645-7282-1 1 March 28th, 2013 11:30 AM
Cant run Chapter03 romee BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 2 February 12th, 2007 06:31 PM
Chapter03 catriona BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 February 12th, 2007 08:42 AM





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