Wrox Programmer Forums
|
BOOK: Ivor Horton's Beginning Visual C++ 2010
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2010 by Ivor Horton; ISBN: 9780470500880
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2010 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 June 17th, 2012, 11:22 AM
Authorized User
 
Join Date: May 2012
Posts: 66
Thanks: 0
Thanked 4 Times in 4 Posts
Default Chapter 2 Exercise 7 (rounding numbers)

I am wondering if anyone else has noticed this and if the edition I am using may not include some needed information.

Exercise 7 (at the end of the chapter, not the programming example earlier in the chapter) asks for the rounding of numbers to the nearest whole number. The solution downloaded from the web site uses the Math::Round() function to round the numbers to be written to the console.

I know a little about C/C++ programming, but am attempting to follow the book using only the concepts presented in the book so far. I reviewed the chapter in an attempt to find a discussion of rounding numbers and found nothing. Therefore I wrote code to manually round the results without the use of any libraries. To my surprise, I found the solution employed Math::Round().

Reading the code in the downloaded solution is intuitive once the existence of the function is known. The issue I have is that the premise of this book is that concepts will be covered on a as needed basis to teach programming in Visual C++. How can a beginner be expected to know how to write the code needed to successfully complete the exercises If the concepts are not covered in the reading material?

Yeah, I know "Google is my friend" for stuff like this, but at this early stage of the book, I don't believe that we should be required to know the proper search parameters and which search result to use as a source for a coding solution to an exercise. This sort of research seems to be much better suited to an advanced programming exercise than a beginner level exercise.

Don't get me wrong. ... I do possess the research knowledge and skills, but to reiterate: I am attempting to confine my solutions to those discussed in the book. I am of the belief that understanding the concepts in the order presented will create a better knowledge base than jumping ahead of the current principles and concepts to write solutions using concepts which have not been covered yet.

drpepper
 
Old October 8th, 2012, 04:50 PM
Registered User
 
Join Date: Oct 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapt 2 Problem 7

Calculate all the numbers for the area and averages of the rooms using
type cast of double. Using the safe_cast conversion (chapt 2) to an integer
value. Print result to console screen

evinarub
 
Old October 9th, 2012, 12:40 AM
Authorized User
 
Join Date: May 2012
Posts: 66
Thanks: 0
Thanked 4 Times in 4 Posts
Default

evinarub

I was not requesting the solution. I was commenting on the solution provided via download form the web page. In that solution a function was used which has not been discussed in the book. Please read my post again, and you will see what I was referring to.

drpepper





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 Exercise 2 rouzbeh_ziafati BOOK: Beginning Microsoft Visual Basic 2010 3 March 14th, 2011 07:21 AM
Chapter 4 Exercise 4 Will BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 2 September 18th, 2009 11:08 AM
Rounding Numbers and Displaying Decimals elygp Crystal Reports 2 May 8th, 2007 10:56 AM
Rounding Numbers ricespn Beginning VB 6 5 November 6th, 2006 05:24 PM
Rounding Numbers ashley_y VB How-To 2 February 3rd, 2004 06:06 AM





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