 |
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 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
|
|
|
|

September 24th, 2004, 04:06 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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)) ;
|
|

October 18th, 2004, 09:16 PM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
|
quote:2. b - variable names cannot begin with a numeral
|
e. wrox.com is also not a valid variable name.
|
|

October 19th, 2004, 03:20 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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).
|
|

November 14th, 2004, 11:39 PM
|
|
Registered User
|
|
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

April 9th, 2005, 12:35 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ÃëÃÃÃÃÃÃÃÃÃï¿ÃÃÃÃõ½<<C# Web æÃóÃÃòÃëÃÃ
¾Âµä>>µÃô³ÃÃò ÃÃÃÃ
|
|

April 12th, 2005, 09:08 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

January 9th, 2007, 10:50 PM
|
|
Registered User
|
|
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Where can I find the answers of the whole exercises?
|
|

February 15th, 2007, 06:03 PM
|
|
Registered User
|
|
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Convert.ToString is not necessary on last line...
|
|
 |