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
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 .
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)) ;
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).
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.