私は、水の使用量に基づいて請求書を決定するビジュアルベーシック用にこのプログラムを書いています。私の問題は、入力したすべての値がコマンド プロンプトでゼロとして返されることです。このコードの何が問題なのか誰か説明できますか?
Option Explicit On
Option Strict On
Imports System
module eurekawatercompany
Sub Main ()
' Declare variables of problem
Dim waterusage as double
Dim totalcharge as double
' Prompts for user to enter their water usage.
Console.write ("Please enter your current water usage (cubic feet): ")
waterusage = convert.toint32(console.readline())
If (waterusage < 1000) then
totalcharge = 15
End If
If (1000 > waterusage) and (waterusage < 2000) then
totalcharge = 0.0175 * waterusage + 15
End If
else if (2000 < waterusage) and (waterusage > 3000) then
totalcharge = 0.02 * waterusage + 32.5
End If
' 32.5 is the price of exactly 2000cm^(3) of water
else if (waterusage > 3000) then
totalcharge = 70
End If
Console.out.writeline ("Total charge is: ")
Console.out.writeline (totalcharge)
End sub
End Module