Skip to Content
Beginning ASP.NET 3.5: In C# and VB
book

Beginning ASP.NET 3.5: In C# and VB

by Imar Spaanjaars
March 2008
Intermediate to advanced content levelIntermediate to advanced
766 pages
21h 15m
English
Wrox
Content preview from Beginning ASP.NET 3.5: In C# and VB

5.8. Exercises

  1. Considering the fact that the oldest person in the world lived to be 122, what's the best numeric data type to store a person's age? There are bonus points to collect if you come up with an even better alternative to store someone's age.

  2. What does the following code do?

    VB.NET

    DeleteButton.Visible = ShoppingCart.Items.Count > 0

    C#

    DeleteButton.Visible = ShoppingCart.Items.Count > 0;
  3. Given the following class Person, what would the code look like for a new class PersonWithPhoneNumber? Make use of inheritance to create this new class.

    VB.NET

    Public Class Person
      Private _name As String
      Public Property Name() As String
        Get
          Return _name
        End Get
        Set(ByVal value As String)
          _name = value
        End Set
      End Property
    End Class

    C#

    public class Person
    {
      public string Name { get; set; }
    }
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning ASP.NET 4: in C# and VB

Beginning ASP.NET 4: in C# and VB

Imar Spaanjaars
Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Bill Evjen, Scott Hanselman, Devin Rader

Publisher Resources

ISBN: 9780470187593Purchase book