Results 1 to 2 of 2

Thread: Need help with a program

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    1

    Need help with a program

    I got in a little over my head when I took a VB class this semester, I had almost no experience on a computer, let alone programming. This latest program has me a bit comfused and I figured this is the place for help...

    Normally our assignments have a demo program with code to go along with it, and it has helped me enough so far to pass the class, this time I am not so lucky.

    Basically I have to have the data from a text file on a disk show up in a listbox when a button is clicked. Here is the actual problem:

    --The table below shows prices for items in a store. Suppose the prices will be reduced for a sale. The new price with be computed by reducing the old price by 10%, rounding to the nearest dollar, and then subtracting one cent. If the new price is greater than the old price, the old price is use as the sale price. Write a program to display the output shown below:
    -------------------------------------------
    Item Sale Price
    Gumshoes 35.99
    Sandals 18.99
    Shirt 6.99
    Handbag 29.99
    Syrup 6.75
    Vest 21.99
    NightShirt 23.99
    -------------------------------------------

    Original prices in the txt file before showing up on the listbox are:
    39.00
    21.00
    7.75
    33.00
    6.75
    24.00
    26.00

    -----


    Anyway, I know this is probably easy for most of you, but I have been trying for 2 hours and have no clue what to do. I would appreciate any and all help I could get on this. Thanks. . .

  2. #2
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    man, I wish i could take a vb course at my skewl (easy credit).

    but it looks like some of your values here are wrong, eather that or my brains fried and thats a definite possiblity

    this is forumula i used to check your numbers

    newnum = (Math.Round(oldnum*.9))-0.01

    for example reg price: 39.00, new price: 35.99

    35.1=39*.9 'find 90% of 39 or 39-10% of 39
    35=Round(35.1)
    34.99=35-.01

    34.99 <> 35.99

    did you forget to say sumtin?
    also post the whole contents of the data file.
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width