Click here to Skip to main content
15,887,746 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Error : Property is readonly Pin
dilkonika7-Apr-14 7:49
dilkonika7-Apr-14 7:49 
GeneralRe: Error : Property is readonly Pin
Eddy Vluggen7-Apr-14 8:53
professionalEddy Vluggen7-Apr-14 8:53 
GeneralRe: Error : Property is readonly Pin
dilkonika7-Apr-14 9:44
dilkonika7-Apr-14 9:44 
GeneralRe: Error : Property is readonly Pin
Eddy Vluggen8-Apr-14 8:01
professionalEddy Vluggen8-Apr-14 8:01 
QuestionCalculations Help! Pin
Member 107286676-Apr-14 8:33
Member 107286676-Apr-14 8:33 
AnswerRe: Calculations Help! Pin
Dave Kreskowiak6-Apr-14 8:37
mveDave Kreskowiak6-Apr-14 8:37 
GeneralRe: Calculations Help! Pin
Member 107286676-Apr-14 8:48
Member 107286676-Apr-14 8:48 
GeneralRe: Calculations Help! Pin
Member 107286676-Apr-14 8:49
Member 107286676-Apr-14 8:49 
VB
Sub Main()
    Dim customerType As String
    Dim unitsConsumed As Decimal = 0
    Dim costPerUnit As Decimal = 0
    Dim totalCharges As Decimal = 0
    Do
        Console.Write("Enter the customer type as commercial, industrial, or residential: ")
        customerType = Console.ReadLine()
        While customerType <> "commercial" And customerType <> "industrial" And customerType <> "residential"
            Console.WriteLine("ERROR - Enter commerical, industrial, or residential.")
            Console.Write("Enter the customer type as commercial, industrial, or residential: ")
            customerType = Console.ReadLine()
        End While
        Console.Write("Enter the units consumed: ")
        unitsConsumed = Console.ReadLine()
        While unitsConsumed < 0
            Console.WriteLine("ERROR - Please enter a value greater than zero.")
            Console.Write("Enter the units consumed. ")
            unitsConsumed = Console.ReadLine()
        End While
        If unitsConsumed <= 1000 Then
            costPerUnit = 0.5
            If unitsConsumed < 1000 Then
                costPerUnit = 0.5
                If unitsConsumed < 800 Then
                    costPerUnit = 0.65
                    If (unitsConsumed > 800) And (unitsConsumed <= 2000) Then
                        costPerUnit = 0.55
                        If unitsConsumed > 2000 Then
                            costPerUnit = 0.5
                            If unitsConsumed < 500 Then
                                costPerUnit = 0.85
                                If unitsConsumed >= 500 Then
                                    costPerUnit = 0.75
                                End If
                            End If
                        End If
                    End If
                End If
            End If
        End If
        totalCharges = unitsConsumed * costPerUnit
        Console.WriteLine("The total charges are: " & totalCharges)
        Console.ReadLine()
    Loop
End Sub

GeneralRe: Calculations Help! Pin
Member 107286676-Apr-14 8:50
Member 107286676-Apr-14 8:50 
GeneralRe: Calculations Help! Pin
Mycroft Holmes6-Apr-14 12:55
professionalMycroft Holmes6-Apr-14 12:55 
GeneralRe: Calculations Help! Pin
Eddy Vluggen7-Apr-14 7:46
professionalEddy Vluggen7-Apr-14 7:46 
AnswerRe: Calculations Help! Pin
ZurdoDev7-Apr-14 8:46
professionalZurdoDev7-Apr-14 8:46 
QuestionRefresh Devexpress Master-Detail gridcontrol Pin
dilkonika5-Apr-14 6:04
dilkonika5-Apr-14 6:04 
QuestionFree Twain for .NET Pin
dilkonika4-Apr-14 11:36
dilkonika4-Apr-14 11:36 
AnswerRe: Free Twain for .NET Pin
Richard MacCutchan4-Apr-14 23:21
mveRichard MacCutchan4-Apr-14 23:21 
QuestionAdd Multiple Records to one TextBox from SQL Pin
Dan O'Riordan2-Apr-14 23:52
Dan O'Riordan2-Apr-14 23:52 
AnswerRe: Add Multiple Records to one TextBox from SQL Pin
Richard MacCutchan3-Apr-14 0:07
mveRichard MacCutchan3-Apr-14 0:07 
GeneralRe: Add Multiple Records to one TextBox from SQL Pin
Dan O'Riordan3-Apr-14 0:15
Dan O'Riordan3-Apr-14 0:15 
GeneralRe: Add Multiple Records to one TextBox from SQL Pin
Richard MacCutchan3-Apr-14 0:22
mveRichard MacCutchan3-Apr-14 0:22 
GeneralRe: Add Multiple Records to one TextBox from SQL Pin
Dan O'Riordan3-Apr-14 0:26
Dan O'Riordan3-Apr-14 0:26 
GeneralRe: Add Multiple Records to one TextBox from SQL Pin
Richard MacCutchan3-Apr-14 0:31
mveRichard MacCutchan3-Apr-14 0:31 
GeneralRe: Add Multiple Records to one TextBox from SQL Pin
Dan O'Riordan3-Apr-14 0:38
Dan O'Riordan3-Apr-14 0:38 
GeneralRe: Add Multiple Records to one TextBox from SQL Pin
Richard Deeming3-Apr-14 0:55
mveRichard Deeming3-Apr-14 0:55 
GeneralRe: Add Multiple Records to one TextBox from SQL Pin
Dan O'Riordan3-Apr-14 1:03
Dan O'Riordan3-Apr-14 1:03 
GeneralRe: Add Multiple Records to one TextBox from SQL Pin
Richard Deeming3-Apr-14 1:14
mveRichard Deeming3-Apr-14 1:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.