ASP.Net 3.5 1. Considering the fact that the oldest person in the world lived to
ID: 3625021 • Letter: A
Question
ASP.Net 3.51. Considering the fact that the oldest person in the world lived to be 122, what is the best numeric data type to store a person’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 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; }
}
Explanation / Answer
1.The best numeric data type to store a person’s age is an integer Datatype. Ex: Dim age as Integer. 2. If ShoppingCart items count greater than 0,then the Delete button is visible otherwise invisible. 3. New Class by using inheritance: Public class PersonWithPhoneNumber Inherits Person 'Private member varibles Private PhoneNumber as Integer 'PhoneNumber PropertyPublic Property Number() As String
Get
Return PhoneNumber End Get
Set (ByVal value as String)
PhoneNumber = value
End Set
End Property
End Class
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.