prabha_friend
Prabhakaran Karuppaih
- Local time
- Tomorrow, 02:42
- Joined
- Mar 22, 2009
- Messages
- 916
Code:
Imports Microsoft.VisualBasic
Public Class Vegetable
Dim NameVal As String
Property Name() As String
Get
Return NameVal
End Get
Set(value As String)
NameVal = value
End Set
End Property
End Class
Code:
Imports Microsoft.VisualBasic
Public Class Vendor
Public ListOfVeggies As New List(Of Vegetable)
Dim Vendor_Name As String
Public Property Name() As String
Get
Return Vendor_Name
End Get
Set(value As String)
Vendor_Name = value
End Set
End Property
Public Sub AddVegetable(ByVal Vegetable1 As Vegetable)
ListOfVeggies.Add(Vegetable1)
End Sub
Public ReadOnly Property VeggiesHandling() As List(Of Vegetable)
Get
Return ListOfVeggies
End Get
End Property
End Class
Code:
Imports Microsoft.VisualBasic
Public Class Bill
Dim Bill_Vendor As New Vendor
Public Property Vendor() As Vendor
Get
Return Bill_Vendor
End Get
Set(value As Vendor)
Bill_Vendor = value
End Set
End Property
Dim BilledVeggies As New List(Of Vegetable)
Dim Billed_Qty As New List(Of Double)
Dim Bill_Amount As New List(Of Double)
Public Sub AddToBill(ByVal Vegetable1 As Vegetable, ByVal Qty As Double, ByVal Price As Double)
BilledVeggies.Add(Vegetable1)
Billed_Qty.Add(Qty)
Bill_Amount.Add(Price)
End Sub
End Class
Code:
Imports System
Imports System.Reflection.Metadata.Ecma335
Imports System.Security.Cryptography.X509Certificates
Module Program
Public Sub Main()
Dim Tomato As New Vegetable
With Tomato
.Name = "TomatoNadu"
End With
Dim Onion As New Vegetable
With Onion
.Name = "Onion Big"
End With
Dim Chilly As New Vegetable
With Chilly
.Name = "Chilly"
End With
Dim Ginger As New Vegetable
With Ginger
.Name = "Ginger"
End With
Dim Garlic As New Vegetable
With Garlic
.Name = "Garlic"
End With
Dim MGM As New Vendor
With MGM
.Name = "MGM"
.AddVegetable(Tomato)
End With
Dim NSR As New Vendor
With NSR
.Name = "NSR Vegetables"
.AddVegetable(Chilly)
.AddVegetable(Onion)
.AddVegetable(Garlic)
End With
Dim Bill1 As Bill
With Bill1
.Vendor = MGM
.AddToBill()
End With
Dim Althaf As New Restaurant
With Althaf
.Name = "Althaf Restaurant"
.Shipping = 50
End With
Dim Sathars As New Restaurant
With Sathars
.Name = "Sathar's"
End With
Dim Sivas As New Restaurant
With Sivas
.Name = "Sivas Restaurant"
.Shipping = 80
End With
Dim Invoice1 As New Invoice
With Invoice1
.Restaurant = Althaf
.AddVegetable(Tomato, 3)
.AddVegetable(Onion, 2)
.AddVegetable(Chilly, 0.5)
.AddVegetable(Ginger, 0.25)
End With
Console.Write(Invoice1.Invoice_Amount)
End Sub
End Module
