Calculate total product cost including VAT.When you type m圜ar. you will get the list of methods this class has. Finally, we print out the details the user entered. Then we print to the console and read the user’s results, as in previous tutorials. This class is quite simple: First we create the variable m圜ar and then initialize it. In the Module.vb file, add: Dim m圜ar As New Car()Ĭonsole.WriteLine("Please enter your car manufacturer: ")ĭim m As String = m圜ar.manufacturer(Console.ReadLine())Ĭonsole.WriteLine("Please enter car model :")ĭim mo As String = m圜ar.model(Console.ReadLine())Ĭonsole.WriteLine("Please enter car colour")ĭim c As String = m圜ar.colour(Console.ReadLine())Ĭonsole.WriteLine("You car details: " & vbLf & " " & m & " " & vbLf & " " & mo & vbLf & " " & c) Here we have made several methods and are simply returning the parameter. Public Function colour(vcolour As String) Copy the code below: Public Function manufacturer(vmanufacturer As String) Next we are going to create some methods. In solution explorer, right click on classes and make a new class file. Create a new Visual Basic Console Application and name it Classes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |