Start New Discussion within our Software Development Community

How would I ask the user to input what type of engine they want and getting an output of $150

Console.WriteLine("Enter EngineChoice for your vehicle:")
        Response = Console.ReadLine()
        EngineChoice = Convert.ToString(Response)

        If EngineChoice = Sixcylinder Then
            Convert.ToInt32(Response)
            Console.WriteLine(150)
        ElseIf EngineChoice = Eightcylinder Then
            Console.WriteLine(475)
        ElseIf EngineChoice = Diesel Then
            Console.WriteLine(750)

This is a console app or is that just for your example? If a console app, I would start by displaying a list of the choices they have to pick from with an item/row number starting each line and then asking for them to type that item/row number in for the input. Also remember what is read/written is already text even if there writing a number...

Dim strEngineChoice As String = ""

        Console.WriteLine("Enter 1 for six cylinder")
        Console.WriteLine("Enter 2 for eight cylinder")
        Console.WriteLine("Enter 3 for disel")

        strEngineChoice = Console.ReadLine

        Select Case strEngineChoice
            Case "1"
                Console.WriteLine("Price : $150")
            Case "2"
                Console.WriteLine("Price : $475")
            Case "3"
                Console.WriteLine("Price : $750")
            Case Else
                Console.WriteLine("Invalid selection")
        End Select
This question has already been answered. Start a new discussion instead.