VS 2008 - The Program Keeping A Running Total?

Dec 9, 2010

I'm about to pull my hair out with this program. I need the following program to keep a running total of the total amount due by a customer for books bought. The exercise required the use of a BookSale class with 3 attributes(a quantity,price,and total due) and 2 behaviors(a default constructor and method that keeps a running total). Here is the code for the class:

[code]...

My problem lies in the program keeping a running total. The total due is displayed fine for each quantity and price but not the whole running total. For example,if I enter 1 as quantity and 2 as price and click the Add to Sale button,the Total Due value,which is $2.00,is displayed. However,if I change the quantity to 2 and price to 4,which comes out to $8.00,the $8.00 is not added to the existing $2.00. I feel like I'm missing something elementary and it's driving me crazy. I would work on it some more but it's already after 4 AM here and I need to get some sleep.BTW,this exercise is from a college textbook. However,this isn't an assignment that is due. I just got bored and decided to work on a chapter we didn't have time to get to.

View 2 Replies


ADVERTISEMENT

Installation - VB - Keeping A Program That Is Running On A Network Updated

Feb 5, 2010

I'm looking for suggestions on keeping a program that is running on a network updated. Installation consists of 15 users, each have the program on their local pc, but they all access same date from sql server. I am looking for a clean method that would allow me to update one folder on the network and for each computer to get updated when they run the program and the programs sees a later ver on that folder on the network. (Obviously I can do this inside the program itself since it won't allow being overwritten while opened.)

View 3 Replies

Creating A Program Showing Total Running Processes

Apr 13, 2010

I'm creating a small application and want to add function which shows the total running processes in windows. What are the codes for that button?

View 1 Replies

Keeping A Total - Size Of Pizza Which Is A Combo Box (CmbSize)

Apr 7, 2011

Anyway I am writing a program to allow the user to enter:

-size of pizza which is a combo box (CmbSize)
-type (thin crust or standard) of pizza which is a combo box (CmbType)
-pizza choice (spicy chicken, maryland etc) using a checked listed box (ChkdListChoice)

The problem I have that will probably be simple to a lot of you who are using this language frequently is that I simply want keep a running subtotal of the users choice. So for example the user chooses 8" Spicy Chicken - 3.50, then they press the BtnAddToOrder button to output it to the Textbox (TxtPizzaChoi). When the user adds the next pizza I simply want the previous pizza price to be added to this one giving a new subtotal. I have not made the price change if the user changes the size to 12" spicy chicken, the price is still 3.50, simply because I think this could make it more difficult to me and I don't have lots of time to work on this. My declarations are not all in use and i may not need them by the way.

Heres the code:

Public Class PizzaChoices
Dim price As Decimal
Dim topping As Decimal

[CODE]...

View 2 Replies

Basic Calculation - Keeping Track Of Total Number Of Discounts

Sep 5, 2009

I am trying to keep track of the total number of discounts given (whole numbers) I keep getting .75 after the first discount, and it adds .75 for every trans action after that. I have tried to pick it apart but I just don't see it. You can follow by tracking the comments that relate to the summary. I know that is an Integer but the book has it declared as a decimal so I went with it.

Public Class BookSaleForm
'Declare module level variables
Private QuantitySumInteger, SaleCountInteger As Integer
Private DIscountSumDecimal, DiscountedPriceSumDecimal As Decimal
Const DISCOUNT_RATE_Decimal As Decimal = 0.15D
[Code] .....

View 2 Replies

Payroll Calculator - Program Must Calculate And Display The Total Pay In The Total Pay Label

Oct 6, 2010

The pay rates for the project are:

a. Level 1 - $10.00
b. Level 2 - $12.00
c. Level 3 - $14.00
d. Level 4 - $16.00
e. Benefit Deduction Rate - 0.10
f. Overtime Factor - 1.5

For ease of program maintenance, all of the above rates and factors must be stored in module level constants. All references to pay rates in the program must refer to the module level constants.

When the Calculate button is clicked:

a. The value in the Hours text box must be validated to insure that it is numeric value greater than zero.

1. If the value is not valid, a message box must appear as shown below and the user must be offered the option to continue processing or quit the program.

2. If the user chooses to continue processing, the focus must be set to the Hours text box.

3. If the user chooses to quit, the program must close immediately.

b. If the value is valid, the program must calculate and display the total pay in the Total Pay label.

1. The pay rate is determined by which Job Grade radio button is checked.

2. For hours less than or equal to 40, the total pay is the hours times the pay rate.

3. For hours greater than 40, the total pay is 40 hours times the pay rate plus the hours in excess of 40 hours times the pay rate times the Overtime Factor.

4. If the Full Time radio button is selected, the total pay must be reduced by the Benefit Deduction Rate.

5. The value displayed in the Total Pay label must be formatted with a dollar sign and with two decimal
places.

6. The focus must be set to the Hours text box.

Why i get an error when i try to run this code

Code:

Also the message box, both yes and no close the program.....

View 10 Replies

Compute Total Value Of A Row In Datagridview In Program 2008?

Jul 4, 2009

How can i compute the total value of a row in datagridview in vb 2008[code]...

View 4 Replies

Get A Running Total In A Listbox?

May 24, 2012

I am trying to get a running total to come up in the lstGtotal listbox from the list of totals in the 1stTotal listbox but all that I am getting is the numbers 1stTotal listbox to come up[code]...

View 6 Replies

Running Total SQL For Project

Jan 15, 2012

I am writing an application which calculates profit from 3 column values. The SQL is as follows in vb dataset designer; [code] I want to add another column of 'Total' that may display running profit an a separate column. [code]

View 5 Replies

Add Running Total To Shopping Cart?

Dec 4, 2011

I've created a program that pulls item prices from a database. The problem I'm having right now is that I'd like to display a running total, as the program currently only displays the list of items and their prices.

Private Sub btnGoToCart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGoCart.Click
Me.Hide()

[Code].....

View 1 Replies

Checking Account Running Total?

Apr 19, 2011

For my Visual BASIC class we were asked to create a project to compute your checking account balance.Included in the project should be three radio buttons (deposit,check, and service charge), one text box (the amount),and a read only text box which will show the new balance. The balance should be calculated by adding deposits and subtracting checks and service charges; Each of these must return an updated balance. If there is not enough money to cover a check,do not deduct the check amount, but charge a service charge of ten dollars. The problem I have continually run into is keeping a running balance without using do or for loops. Here is a copy of the code i have come up with which will display only what I enter into the amount text box and put it into the balance read only text box; it will not accumulate.

Code:

Private DepositTotalDecimal, CheckTotalDecimal, ServiceChargeTotalDecimal, BalanceDecimal, AmountDecimal As Decimal
Private DepositCountInteger, CheckCountInteger, ServiceChargeCountInteger As Integer
Private Sub PrintButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintButton.Click[code]....

View 4 Replies

Get Running Total(adding Numbers)?

Oct 28, 2010

how to get running total(adding numbers).

View 1 Replies

Running Total For Searched Strings?

May 7, 2012

Had this issue I was wondering about. This is what it actually DOES then Ill say what I want it to DO. It grabs the word from a notepad I have saved in the directory, and brings it forward onto a form in designated area's and after whomever is done with the word and definition. It'll tell you how many times it's been looked up. Problem is the count applies NOT to the individual words as I'd have liked but EVERY word that has been searched for in the session.: Here's a snip-it

[Code]...

how to get the count to apply for each word individually. Either just within the session or, if possible, keep a constant running total of searched words.

View 4 Replies

Crystal Reports Running Total Field?

Mar 4, 2009

I have created a cystal report that has a running total field on a cost entry on the report. The data comes from a database where the field type is set to numeric with two decimal places. However when i run the report it doesnt add up the total at all it just brings up 13 (unknown where it gets this from as the value is in the thousands.

[Code]...

View 2 Replies

How To Calculate A Running Total From Items In A Listbox

Oct 25, 2008

I am having an issue with trying to calculate a running total from items in a listbox. I am getting an InvalidCastException with the btnCalc_Click event. I think I understand why I am getting this exception, just not sure exactly how I fix it.

I need to have the lblTotalCost display the Grand Total of all the workshop totals. Ca anyone point me in the right direction here, I have been struggling with this part for about 2 weeks.[code...]

View 10 Replies

Maintain A Running Total In A SQL Server Database?

Mar 4, 2011

I am using Visaul Studio 2010 to build a Windows Forms application to maintain a table in an SQL Server 2008 database. The table is named CASHBOOK and here are the further details:

DATE | DESCRIPTION | DEBIT | CREDIT | BALANCE
--------|----------------|---------|-----------|---------
1/1/2011| CASH BALANCE | | | 5000
1/1/2011| SALES | 2500 | | 7500
2/1/2011| PURCHASE | | 3000 | 4500
2/1/2011| RENT | | 4000 | 500
2/1/2011| SALES | 5000 | | 5500

I can use CASHBOOKTABLEADAPTER.INSERT(...) to insert appropriately, but my problem is how do I update the BALANCE column?

View 6 Replies

VS 2010 : Get Running Total On Database Table?

Mar 2, 2011

I'm maintaining a Accounting program.. I have a Cash Book Table in SQLserver Databse...field are DATE DESCRIPTION DR CR RT(Running Total is empty record). When in Insert a transaction into that Table the Running Total should give the correct balance for example :

Date Desc Dr Cr RT (Running Total)
1/1/2011 Cash Balance 5000 5000
1/1/2011 Purchase 2000 3000

[code]....

I'm inserting record into that table through Windows form.

View 12 Replies

Creating A Running Total That Will Be Displayed In A Textbox And Message Box

Mar 9, 2009

i am cannot for the life of me figure out how to create a running total that will be displayed in a textbox and message box. here is what i need to mimick - [URL] this is my code:

[Code]...

View 2 Replies

Using The Split Method To Extract The Itemcost And Then Add It To A Running Total?

Nov 7, 2010

How would I go about using the split method to extract the itemcosts out of a listbox, and then adding them to a running total label?

View 9 Replies

VS 2010 : Getting A Running Total Of The Integers In A Separate Text Box?

Jun 25, 2010

I have a listbox with nothing but integers in it.I want to keep a running total of the integers in a separate text box.

View 3 Replies

Calculate Running Total In Listview Group Extract From Database?

Dec 30, 2011

I'm developing Asset Management System, it will compute for straight line depreciation, my problem is how to calculate running total on each group that I've extracted from my database.Here's a snippet for my extraction of data

Private Sub cboAType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboAType.SelectedIndexChanged
ListView1.Items.Clear()
If Not cboAType.Text = "-" Then

[code]....

View 4 Replies

Keeping Form Visible While Switching To Another Program?

Apr 14, 2009

I have a program that shows a small form appearing at the top of the right hand corner of the screen. When I switch to another opened program, the form disappears. How can I keep this form visible when I switch to another program? I set the TopMost property to true but it doesn't work.

View 1 Replies

VS2010 To Monitor Net Usage And Calculate The Current/total Download And Upload While My Application Is Running?

Dec 22, 2011

Is there a way in VS2010 to monitor net usage, and calculate the current/total download and upload while my application is running?

View 9 Replies

Get The ProcessID Of A Running Program In VB 2008?

Aug 12, 2009

I want my program to use the Appacctivate with a process ID because, the window title of the program I am going to work with is changing.

I tried several thing, but I just can't seem to be able to get the processID of any running applications. I googlet it, and there a several code's out there, but I get a Null Reference Error, with all of them.

which gets the ProcessID of a running program? I tried it with process.getprocessbyname ("myApplication") , dunno whether I was on a godd trail, or is there a far easyer way, even for activating windows without the processID.

View 5 Replies

VS 2008 Get Global Ip Of PC Running The Program

Nov 29, 2009

I would like to get the global ip of the pc running the program in VB and echo the ip into TextBox1

View 20 Replies

VS 2008 Program Running In The Background?

Jun 30, 2009

When you click a button, the program should start op everytime your computer starts, but it must be in the background, so that you wont notice it.

View 4 Replies

[2008]Error When Running The Program?

Mar 9, 2009

i currently have another problem beside programs code , when i give the program to another person and when he tries to open it he get an error Title = WIndowsApplication1Content = Application WindowsApplication1 has a problem and must terminate its operation.We appologize for the inconvenience.

View 10 Replies

VS 2008 Program Still Running In Task Manager

Jan 15, 2010

When i close my program its still running in the task manager, how do i close it completly ?

View 16 Replies

[2008] Changing Between Forms While Running The Program?

Jan 31, 2009

I recently started out using Visual Basic, and I've run into a problem.I need to be able to change between my two forms when I run my program, however since I'm still rather new at this, I've been unable to figure out a way to do this.

View 8 Replies

VS 2008 - Program Running At Startup / Minimize Down To Tray

Apr 16, 2009

1) Is it possible to allow a vb 2008 program to run at computer startup. Meaning, one the computer is turned on, it will load up with all the other startup programs so that it is ready to use.
2) I also would like to know if it is possible to have the program minimize down to the tray where all start up programs usually appear. So that instead of it cluttering up the task bar it will be in the tray and when they clcik or double click it, it will open back up.

View 1 Replies







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