Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Beginning Visual C#
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Visual C#
This is the forum to discuss the Wrox book Beginning Visual C#, Revised Edition of Beginning C# for .NET v1.0 by Karli Watson, David Espinosa, Zach Greenvoss, Jacob Hammer Pedersen, Christian Nagel, Jon D. Reid, Matthew Reynolds, Morgan Skinner, Eric White; ISBN: 9780764543821
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 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 September 24th, 2004, 04:06 PM
Authorized User
 
Join Date: Jul 2004
Location: Saint Peters, Missouri, USA.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning Visual C# Exercises - Chapter 03 Answers

1. super.smashing.great

2. b - variable names cannot begin with a numeral

3. No.
        There is no upper limit on the amount of characters in a string type

4. var1 * var2 (a)
        var3 % var4 (b)
        b / var5 (c)
        a + c
        or (var1 * var2) + ((var3 % var4) / var5)

5. int answer1, answer2, answer3, answer4;
        Console.WriteLine("Enter first of four numbers:");
        answer1 = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("Enter second of four numbers:");
        answer2 = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("Enter third of four numbers:");
        answer3 = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("Enter fourth of four numbers:");
        answer4 = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("The product of these four numbers is {0}!",
            Convert.ToString(answer1*answer2*answer3*answer4)) ;
Reply With Quote
  #2 (permalink)  
Old October 18th, 2004, 09:16 PM
Registered User
 
Join Date: Oct 2004
Location: , , USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 
Quote:
quote:2. b - variable names cannot begin with a numeral
Quote:
e. wrox.com is also not a valid variable name.

Reply With Quote
  #3 (permalink)  
Old October 19th, 2004, 03:20 PM
Authorized User
 
Join Date: Jul 2004
Location: Saint Peters, Missouri, USA.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wrox.Com is a legal variable name. "Wrox" could either be a namespace or an object that variable "Com" has been defined within. (See Exercise 01 above).
Reply With Quote
  #4 (permalink)  
Old November 14th, 2004, 10:39 PM
Registered User
 
Join Date: Nov 2004
Location: Shanghai, , China.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to showby
Default

It lies on your standpoint on the title.If it refers to the concept "namespace", of course "e" is a true variable name.:)

Sorry, my English is so poor.
Reply With Quote
  #5 (permalink)  
Old April 9th, 2005, 12:35 AM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ҵ<<C# Web Ӧóž>>Դ

Reply With Quote
  #6 (permalink)  
Old April 12th, 2005, 09:08 AM
Authorized User
 
Join Date: Jul 2004
Location: Saint Peters, Missouri, USA.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Forum member palsumi has posted a reply to the topic "Beginning Visual C# Exercises - Chapter 03 Answers" in the Beg_VCSharp forum. You have been a participant in this discussion.

[palsumi]
Hello seblake,

------------------------------------------------------
4. var1 * var2 (a)
 var4 / var5 (b)
 var3 % (b)
 (a) + (b)
 and then the final value is incremented by one.

/ operator precedes the % operator. So the computation goes like this.
------------------------------------------------------

[seblake]
No, both the / and % operators are equal in precedence. They are then evaluated as they appear left to right within a formula (except parentheses override).

The left to right evaluation does not refer to their order in the grid listing found on page 53 (Revised editition .NET 1.0). Plug in values and compute in C#. You'll see the sequence at the top of this topic is correct.

Reply With Quote
  #7 (permalink)  
Old January 9th, 2007, 09:50 PM
 is offline
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Where can I find the answers of the whole exercises?

Reply With Quote
  #8 (permalink)  
Old February 15th, 2007, 05:03 PM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Convert.ToString is not necessary on last line...

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
Beginning Visual C# Exercises - Chapter 03 seblake C# 1 July 19th, 2004 09:16 AM



All times are GMT -4. The time now is 11:58 PM.


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