Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #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.
Reply With Quote
  #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);
Reply With Quote
  #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!
Reply With Quote
  #4 (permalink)  
Old October 8th, 2016, 01: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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12:30 PM
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



All times are GMT -4. The time now is 03:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.