hello.
Public Class GasPump
Private name As String
Private quan As Double
Private prequa As Boolean
Private total As Double
Private YN As String
Private Const RegularPrice As Double = 13.08
Private Const PrimePrice As Double = 13.56
Public Sub Start()
Readinput()
Calctotaltopay()
Printrecept()
End Sub
Private Sub Readinput()
Console.Write("What's your name: ")
name = Console.ReadLine()
Console.Write("Thank you " + name)
Console.WriteLine(vbLf & vbLf & "how much do you want: " + name)
quan = Console.ReadLine()
Console.Write(name("Do you want premium y/n"))
YN = Console.ReadLine()
Dim resp As Char = Console.ReadLine().Chars(0)
If ((resp = "y") Or (resp = "Y")) Then
prequa = True
Else
prequa = False
End If
Console.ReadKey()
End Sub
Private Sub Calctotaltopay()
End Sub
Private Sub Printrecept()
Console.WriteLine("+++++++++++++++++++++++++++++++++++")
Console.WriteLine(vbLf & vbLf & "Quality " + YN)
Console.WriteLine("Quantity " + quan)
Console.WriteLine("Price per unite ")
Console.WriteLine("Sum to pay " + total)
Console.WriteLine("+++++++++++++++++" + name("++++++++++++++++++"))
End Sub
End Class
I get Conversion from string "Do you want premium y/n" to type 'Integer' is not valid.
and i dont know how to fix it, and yes i have Option Explicit On, Option Strict On.
And i was wondering how do you get for exempel when you type y in the question y/n and i want the PrimePrice 13.56 in to the Price per unite.