VS 2008 Code To Work Out Cost With Different Prices Per Mile?

Mar 2, 2011

For our programming assignment to end the module (which im really struggling with) we have to write some code for use in a fictional taxi firm that charges �2 for the first mile, one price for miles 2-10, and another for all miles thereafter.

View 11 Replies


ADVERTISEMENT

Computing Cost - Cost Is Displayed Instead Of An Accurate Cost ?

Sep 17, 2010

I am running into trouble with some code I am doing for an assignment. The section within the apostrophes (If Then Else) is the section that I am having trouble with. When the user selects a seat type and then clicks the compute button, the wrong cost is displayed instead of an accurate cost.

Option Strict On
Public Class frmTickets

Private Sub btnComputeCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnComputeCost.Click
Dim intNumberOfTickets As Integer

[CODE]....................

View 6 Replies

Code Total Cost To Give Pound Sign With Total Cost At Moment When Total Comes Up

Jun 7, 2010

How do I code the total cost to give me a pound sign with the total cost at the moment when the total comes up for an example it gives me 3.6 when I need it to show £3.60 here is the code I have so far. [code]

View 2 Replies

VB 2008 Code The Calculations For A Pocket PC Application That Calculates The Cost Of A Cell Phone Bill?

Feb 19, 2010

I'm having trouble figuring how to code the calculations for a Pocket PC application that calculates the cost of a cell phone bill. From a Pocket PC the user should enter the number of minutes used during the past month, in order to calculate the cost of the cell phone bill. The plan allows 300 minutes for $29.95 per month. For each minute over 300 the cost is $0.17 cents per minute. Tax and Fees are $4.85 a month.

1. User enters the number of minutes used during the past month.

2. Based on plan rate of 300 minutes for $29.95 and 17 cents for each minute over 300 calculate the cost of the bill including the fixed cost of $4.85.

3. The user must be able to initiate the calculation and display the individual charges and the total cost of the cell phone bill.

4. The user should be able to clear the number of cell phone minutes, the individual charges and the bill total

If negative number is enterd for the cell phone minutes, the user should be advised and asked for a valid entry If non numeric value entered for the cell phone minutes, or if left blank the user should be advised and asked for a valid entry.Application is deployed on the Pocket PC emulator built in VS 2008

Enter # of Minutes ________ (user enters)
Regular Minutes Charge ___ (29.95)

[code]....

View 1 Replies

Total Cost Button Won't Work?

Jan 15, 2012

When i run the program and click the cost button, it only returns a value of £0.00 for insurance cost and total cost.

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCost.Click
Dim Cost As Double

[Code]......

View 4 Replies

Code A Label To Show The Total Cost?

May 31, 2010

I have a assignment and I have got to do the total cost and put the total in a label, here is the code. Select Case pizza1

[Code]...

View 10 Replies

Translating Decompiled Code - Function That Accepts An Item Name Its Cost And Its Quantity

May 6, 2011

I was wondering if someone could translate this code into a more understandable code. It is suppose to be a function that accepts an item name its cost and its quantity. and adds one more array element to ."items" variable and assigns the given name and cost and quantity.

Public Sub AddItem(ByVal strName As String, ByVal dblCost As Double, ByVal intQuantity As Integer)
Me.items=DirectCast(Utils.CopyArray(DirectCast(Me.items,Array),New Purchase(me.itemsCount + 1)-1){}),Purchase())

End Sub

This is the translation i made but i don't think it is correct.

Public Sub AddItem(ByVal strName As String, ByVal dblPrice As Double, ByVal intQuan As Integer)
Dim items As Purchase() = Me.items
Dim itemCount As Integer = Me.itemsCount
For itemCount = 0 To items.Length - 1

[CODE]...

View 3 Replies

Code An 'increase' Button To Prompt A User To Input A Rate By Which To Increase Select Prices In An Array?

Feb 16, 2009

I'm trying to code an 'increase' button to prompt a user to input a rate by which to increase select prices in an array.It should request the increased rate, then request a number from one to five, representing which price in the array to increase.Then, if 'increase' button is selected again and another number from one to five is chosen, then that element should be increased.It's working, but all the numbers in the array are changed. And, when I hit the increase button again, the array is repopulated below the first price increases instead of only replacing the designated price.

'declare 5 element array of prices
Dim prices() As Double = {12.2, 8.5, 12, 50, 2.4}
Dim rateIncrease As Decimal
Dim isConverted As Boolean

[code].....

View 1 Replies

VS 2008 : Loading Numbers And Prices From The ItemInfo.txt File?

May 25, 2010

im having trouble coding a project Im supposed to Define a structure named Product. It should contain two member variables one a string variable called item number and another a double called Prices. In the form's load event procedure I should be able to the item numbers and prices from the ItemInfo.txt file, and store them in the module-level array. Furthermore, Im supposed to be able to add teh item numbers into the list box. There are no buttons just the Exit button. When user select the item the user should be able to see it in the lblPrice control.

Name: Glovers Project
' Purpose: Displays the price of an item
' Programmer: <your name> on <current date>

[code]....

View 1 Replies

VS 2008 Can't Seem To Get This Code To Work

Nov 26, 2009

Ive been trying to search the registry for all keys called test and return their value, but im not sure how to do it using this example

Imports System
Imports Microsoft.Win32
Imports System.Threading
Public Class Form1

[code]....

View 13 Replies

Does Code From 2005 Work In 2008

Nov 12, 2009

I am a kid who just wants to learn coding with my friend. We bought the book "Microsoft Visual Basic Game Programming FOR TEENS second edition". We realized we were using VB .NET 2008 and the book was programmed in VB. NET 2005. Will the code work. If not, what do I have to change?2) For those familiar with the book, how would I make a Save/Load feature. Where would I add the code?

View 12 Replies

VS 2008 Beginner Unable To Get Code To Work?

Nov 27, 2009

I am having an issue getting my code to work. It is not showing my Look-Up Button for me to calculate the rate based on the weight and zone and it continues to constantly show that I have an error that I cannot seem to correct.

[Code]...

View 4 Replies

VS 2008 Calculating Cost In Project?

Mar 7, 2010

My project, is something that could be used by an opticians (well in theory anyway)I have a customer being selected, eye measurements etc..Then I can enter in data (into textboxes):

TextBox1. Frames Stock: #12345
TextBox2. Material Used: Glass / Plastic
TextBox3. UV Filter: Yes / No

[code].....

View 6 Replies

VS 2008 Cost Calculator Errors

Apr 17, 2010

I was trying to make a calculator which takes the amont of copies you want to make and it tells you the cost. Then you type in the amount you want to enter and if its less a message box comes up saying "please enter more money". I've had a few problems

1. when i use formatcurrency the program crashes for no apparent reason

2. if i calculate cost without entering any copies then it crashes (ive tried putting a msgbox in but it crashes anyway)

3. if i get the msgbox to come up saying "Please enter more money" i had to remove the formatcorrency tag.

View 9 Replies

VS 2008 Why A Code Doesn't Work Anymore After Compile The App

Jan 29, 2010

i have a simple code that send an e-mail, when i try it running in debug mode it works fine, after compile, i run the exe but the same code doesn't work any more..

View 2 Replies

VS 2008 Calculate Price * Quantity = Cost?

Mar 3, 2010

I certainly hope I don't aggravate you with what is certainly a very simple code problem. I have never programmed before, but I do have a background in tech support, etc. I have an assignment to do and it's frustrating to wade through the information out there to find exactly what I need and nothing more.The assignment has 3 parts, one of which i've done. We are to do the same function in both javascript and VB. I was able to take a sample we did in class that caluclates a 10% discount and modify it so it calculates the total. Now, I have to modify that into a VB sln file. then write about the differences but that part will be cake.

I am working in Visual Studio 2008 - that program is new to me as well. When I created my login and it asked what VB I'm using, I did not know but under theu of VS, it says VB 2008.hat I attempted to do was to take the instructor's sample discount code and modify it for the new purpose, but an error was generated. This is the sample code I started with:

'Programmer: Dan Dougherty
'Date: Feb 2010
'

[code].....

View 14 Replies

(VB 2008) Moving Strings / Cannot Make The Code Work When It Gets To Consonants

Apr 11, 2009

I cannot make the code work when it gets to consonants. I cannot get the consonant part correct.

Code:
'Date of last Modification: 4/11/2009
'Pig Latin Converter: Takes and English words and converts it to Pig Latin
'Rules stated in comments within calButton click event procedure

[code]....

View 3 Replies

Application Version Code Not Work In VB 2008 Express Edition?

Oct 19, 2009

I create a new Windows Forms application and add an AboutBox form which is built-in into Visual Studio. I add a button to Form1 to show the AboutBox when clicked.The AboutBox form has a label with the text "Version" on it. The following code is supposed to add the application's version to that label at run-time:

Me.LabelVersion.Text = String.Format("Version {0}", My.Application.Info.Version.ToString)When the application version is changed in the Publish tab of the My Project form to 2-0-3-6, the version on the AboutBox at run-time stays at 1.0.0.0 (of course after rebuilding).

Even when the application is published to the desktop, it still does not work. It does, however, reflect the correct version number in the title of a subfolder in the Applications folder that is created when the application is published.

View 1 Replies

Convert The Following Code To Work In A Visual Studio 2008 Windows Form Application?

Feb 15, 2009

I need to convert the following code to work in a visual studio 2008 windows form application, the moment ObjectQuery, ManagementObjectSearcher, ManagementObject and ManagementObjectCollection are not valid.

im objectQuery As New ObjectQuery("SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionId IS NOT NULL")
Dim searcher As New ManagementObjectSearcher(Scope, objectQuery)

[code].....

View 4 Replies

VS 2008 Finding A Code That'll Work With An "Application Layout" In VB?

Jan 10, 2010

I'm looking for a code that'll work with an "Application layout" in VB that when you press the "Send" button, the fields will be emailed to your email.OR A basic program preset up that i can use..

View 4 Replies

VS 2008 Depreciation Loop - Calculate Straight-line Depreciation (cost * 1/n) N Being The Number Of Years To Depreciate

Jul 25, 2010

I have a program where I have to calculate straight-line depreciation (cost * 1/n) n being the number of years to depreciate, and Double-Declining depreciation (cost * 2/n) using user input for year of purchase, cost, and years of depreciation. The output needs to be put into 4 columns in a list box. Year, Value at beginning of year, Amount of depreciation during the year and Total depreciation to the end of the year.

The problem I am having is with my loop. It is not properly calculating. I'm sure I am doing something wrong that is simple, but I can't see it.

Here is my code; the problem areas are bold:

Public Class frmDepreciation

Dim Cost, Life, Year, Depreciation, BegValue, EndValue, Total, Counter As Double
Dim fmtStr As String = "{0,-10}{1,10}{2,17}{3,5}{4,-15}"
Dim fmtStr2 As String = "{0,-10}{1,10}{2,17}{3,15}"

[CODE]....

View 3 Replies

Sum Prices From Different Forms?

Dec 25, 2010

I want to do a project in vb.net 2008 using database from MS Access 2007. I have to go from the main menu to the other forms, in each form I have to select one or more items, each item has a price (should be taken from the database *.accdb), then I have to return to the main menu, click the cost button to find the total cost of these items.

1. Where I have to write the code to access my database, in the main menu or in each form individually? and how to write it? I used the code found at:

http:[url]......

but after DEBUGging told me that it cannot see "Table1"?

2. When I am in one of the forms, do I have to "save" my selections, and how?

3. How do I exit from any of the forms to give me the total price to the step, form, I have reached?

4. The total cost should appear in a separate form (screen) at the same time should be saved?

View 10 Replies

Using IF Statements To Add Together Prices Using VB

Jan 29, 2012

I am trying to use if statements to add the prices of a cruises special packages together. I am using check boxes for the packages, so any, from none to all 3 are able to be checked. The packages available are VIP, excursion and restaurant. The price will also depend on the cruise length (7 or 10 day). I am wondering on which format to use, and if I even need to use if statements, how to make this statement true,

View 1 Replies

VS 2008 Could Not Get Form To Work On Work Computer

Aug 21, 2009

I have a form that works on my local Machine I created into. I have Office 2007 on this machine. I created the Form with the Excel 12 Reference. I move the Entire conetence of the Project folder to my work computer. Which has Office 2003. Do I need to recreate the form with the Excel 11 reference. I could not get the form to work on work computer. IT has a com error. I am acessing the EXE for the debug folder w/in the Bin Folder.

View 7 Replies

Add Prices And Display Result?

Mar 6, 2010

I have a school project, and for some reason in the book it doesn't show how to keep a variable cross sub functions. Can anyone give me a clue of what i'm doing wrong ?

Here is my code
Private Sub processButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles processButton.Click

[code].....

View 2 Replies

ASP.NET VB Changes In Stocks Prices Prompt

Aug 12, 2011

I'd like to ask about the way in ASP.NET VB to detect the changes in stocks prices, if the price inceased, the containing cell inside the grid blinks in green, decreased will blinks in red? ex: if the price now 10.00$ and increased to 10.01$ the containing cell will blink with 1 second in green..

View 1 Replies

Round The Prices In This Manner: If It's 12.48 Should Be 12.99?

Aug 12, 2009

I want to round the prices in the following manner: if it's 12.48 should be 12.99, if it's 12.98 it should be 12.99, if it's 12.10 should be 11.99 and so on.

View 39 Replies

Add The Checkbox Prices Up To Display In The Label?

Dec 30, 2010

i have a form and it has checkboxes that are different prices for options on a car. my problem is I don't know how to write the code to add the checkbox prices up to display in the lable.

View 4 Replies

How To Assign Prices To Each Model From The Combo Box

Mar 3, 2009

Anyway for my vb class we need to write an auto inquiry system. Im a total n00b and am struggling altogether. My interface is below Basically what my problem is (among others) is that I don't know how to assign prices to each model from the combo box. This is what I used to populate the two boxes:

[Code]...

View 9 Replies

Calculate Prices Of An Item From An Existing Textfile?

Jun 3, 2011

In calculating an item from a texfile that exists from menu_cmbselectedIndex,i want to display total number of items when i click a combobox and should also display total amount for those items.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved