Here is the problem I am working on. It asks me to use the method CalculateCharges, but I don't fully understand how to do this or how it works. I would be grateful for any input.
Lab Problem III
A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours.
The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Develop a console program that calculate and displays the charges for each customer who parked a car in this garage yesterday.
You should input hours parked for each customer. The program should display the charge for the current customer. The program should use the method CalculateCharges to determine the charge for each customer.
The program should input as Double the hours parked by each customer. The program should continue asking for new customer until sentinel value is entered for hours parked.
I have an issue with my DO While loop (it has to be a DO While loop). It is supposed to loop until a value of -99999 is entered for the value of previousReadiing. The program works, and it will stop after -99999 is entered, but only after it goes through the rest of the loop.How do I get this to end rather than have to finish through the other input statements and calculating again?This is homework so I don't want the answer, but can I get a nudge in the right direction please?
Module ElectricBill ' program to compute a consumer�s electric bill. It will calculate the bill for one or more customers
if anyone here has ever worked with Sentinal HASP keys to protect applications.I understand how to make features in the keys but i do not understand what i need to include in my project to have it authenticate against the HASP at runtime.
Consider a MyForm class that contains a shadowed implementation of Show(). It also contains a CreateForm() method, which accepts an instance of the form and calls the shadowed sub:
I have a large problem with inheritance in vb.net. The problem is the following:
I have 2 forms => frmBase and frmChild
In frmBase i want to create a method Called StartWorking() and i want frmChild to inherit this method.
But here is the tricky thing: when frmChild.StartWorking is called i would like the following => without calling MyBase.StartWorking()
I want frmBase.StartWorking() to be executed first and after a test in frmBase.StartWorking if blnValue is true then frmChild.StartWorking has to be activated. if blnValue is false that frmChild.StartWorking cannot be activated.
I have nine pictures that I need to animate -I need to use the ToString method and a counter to concatenate a file name into a string variable from the Image.FromFile method. Once the counter reaches its maximum value, and the last picture is displayed, the counter should be reset to zero or one depending on how the first image file has been name. Also a static counter variable should be incremented in the time routine. what I have so far -- I know what I have to do; however, I just do not know how to code this properly.. Right now I have this going thru a button procedure but it needs to go through a timer.
When I am loading an Assembly dynamically, then calling a method from it, I appear to be getting the method from Assembly executing before the code in the method that is calling it.It does not appear to be executing in a Serial manner as I would expect. Can anyone shine some light on why this might be happening. Below is some code to illustrate what I am seeing, the code from the some.dll assembly calls a method named PerformLookup. For testing I put a similar MessageBox type output with "PerformLookup Time: " as the text. What I end up seeing is:
First: "PerformLookup Time: 40:842" Second: "initIndex Time: 45:873" Imports System
Why does my the declaration of my string in the code result in the following error? Is there a workaround?
Code:
<script runat="server"> Protected Sub form1_Load(sender As Object, e As System.EventArgs) Dim x As String = "</script>"
[code]....
Error: Statement cannot appear within a method body. End of method assumed.
Note: The following page did not fix my issue and instead resulted in the string </script> being output in my page. ( VB.NET hates </script> tag in string literal )
I am not sure whether this is a trick question?One of the object i have has 2 boolean properties, Standing and Sitting.I have a class called student with the 2 methods stated below- Am I coorrect is assuming that the first method draw() is affected by the standing property AND not the second method?Also the way it affects is that it draws an image when the the stugent is standing?
Let's say I have a page Test.aspx along with test.aspx.vb.Test.aspx.vb contains a class name "TestClass". In that class I have method1(), method2() and method3()I need to be able to call one of those methods, but I can't hard code it, the method to be executed comes from a string.
I can't do Select Case StringContainingTheNameOfTheDesiredMethod Case "Method1"
Extension methods are useful for types that you don't own and can't/don't want to derive from and extend (e.g. reference types and interfaces). Obviously, interfaces should be kept as short and to-the-point as possible, so extension methods for interfaces are particularly useful (e.g. LINQ).For classes, especially classes that you own, they're still useful - but I'm wondering how you determine what should be an extension method or what should be a method in the class itself.Personally, every time I think about it, I keep going round in circles with the following thoughts:If it's useful enough, it should be in the class.It's not part of the core responsibility of the class, it should be an extension method - but if it's useful enough, surely it should be the responsibility of the class...
I have a Application that Crypts all Files in a Directory and the Subdirectories
Public Shared Sub CryptAllFiles(ByVal crypt As Object) 'check if this dir exists Dim vDirInfo As New DirectoryInfo(vPath) If Not vDirInfo.Exists Then Exit Sub 'get all files' sizes in current path
Is there a way to choose between different methods and pass one into another method ?
Sub conditionnal_binding(ByVal list_box_reference As ListBox, ByVal list_box_final As ListBox, _ ByVal dico_source As Dictionary(Of String, List(Of String)), _ ByVal my_methode As ??? ) ' DO SOMETHING End Sub
I wrote ??? because I don't know how to call another method inside a method. I would like to choose between different "sub-methods". Here is how I would like to use my method :
I'm trying to code an application that selects an appropriate delivery method from a list box. The user should be able to enter a part number consisting of numbers and either one or two letters. "MS" representing "Mail-Standard, "MP" for "MailPriority", "FS" for "FedEx-Standard", "FO" for "FedEx "Overnight" and "U" represents "UPS" I want to code it so that it does the above and displays an appropriate message when the part number contains an invalid letter or letters.
Option Explicit On Option Strict On Public Class MainForm
i want to which way is better when concentration is on processing speed. i want to call a method that compute some data that method is on another form in my windows form application then what you prefer is better way 1) to call that method in another form and use returned value or create similar method in form where it is required.i want to make it's processing fast.
I'm trying to code a class of RandomNumber. One of the class methods needs to populate a "List (Of RandomNumber)" ... which was passed as a parameter to the method ... with 10 random numbers between 1 and 50. DEAD SIMPLE :)
I have been using a pretty slick generic invoke method for UI updating from background threads. I forget where I copied it from (converted it to VB.NET from C#), but here it is: Public Sub InvokeControl(Of T As Control)(ByVal Control As t, ByVal Action As Action(Of t))
I don't want use old VB methods in my code and I m confused about what's the newest vb.NET method corresponding to the old CInt() VB method for example,
Dim n1 as Double : n1 = CInt(2.1111111) 'get only 2 without round it Dim n2 as Double : n2 = CInt(2.7777777) 'get only 2 without round it
This code works well ... But it should not I agree that "Value.One" implements IConvertible, but:the method "ToBoolean" is a private method of Value.One Why can I expose it outside of the class ( As far as I could test, this is true for everything that implement an interface nothing can be private )
I have a class that I'm developing something like an SQLHelper class. I have put a function in the class called ExecuteNonQuery and I want to add a method to this function to return the result in a datatable something like this.
Dim util as new Util.SQLHelper("ConnectionString") util.AddParameter("@param1", "Value") Dim dt as DataTabla = util.ExecuteNonQuery("sp_Test", Data.CommandType.StoreProcedure).ToDataTable()