Basic Profit Calculating Program

Discussion in 'Programming General' started by Y0u_G0t_Pwn3d, Oct 17, 2009.

Basic Profit Calculating Program
  1. Unread #1 - Oct 17, 2009 at 9:47 PM
  2. Y0u_G0t_Pwn3d
    Joined:
    Feb 11, 2007
    Posts:
    1,478
    Referrals:
    0
    Sythe Gold:
    0

    Y0u_G0t_Pwn3d Guru

    Basic Profit Calculating Program

    I have made this simple program for the use of anyone, the code is open for improvements and I myself may improve on it. It is coded in BASIC in a program called Just Basic. (Found at www.justbasic.com for free.) I want to add more options and more functionality but for now this is it:

    Code:
        nomainwin
    
        WindowWidth = 300
        WindowHeight = 250
        UpperLeftX = 200
        UpperLeftY = 150
        button #profit.calc, "Calculate", [calcClicked], LR, 60, 10
        statictext #profit.desc, "NOTE: This program assumes you sell all of the items bought.", 40, 145, 200, 25
        textbox #profit.field1, 40, 15, 200, 25
        textbox #profit.field2, 40, 50, 200, 25
        textbox #profit.field3, 40, 85, 200, 25
        textbox #profit.field4, 40, 120, 200, 25
        open "Profit" for window as #profit
    
        print #profit, "trapclose [quit]"
    
    [start]
    
        print #profit.field1, "Total Money"
        print #profit.field2, "Number Of Items Bought"
        print #profit.field3, "Price Bought For"
        print #profit.field4, "Price Sold For"
    
        wait
    
    [calcClicked]
    
        print #profit.field1, "!contents? tmoney"
        print #profit.field2, "!contents? ibought"
        print #profit.field3, "!contents? pbought"
        print #profit.field4, "!contents? psold"
    
            let totalpaid = ibought * pbought
            let endmoney = psold * ibought
            let profit = endmoney - totalpaid
            let profitpercent = (profit / tmoney) * 100
            goto [profitNotice]
    
    [profitNotice]
    
        notice "Your Profit In Gold is: "; profit
        notice "Your Percentage Of Profit is: "; profitpercent; "%"
    
    
        confirm "Calculate Another? (Y/N)?"; play$
        if instr("YESyes", play$) then goto [start]
    
    
    [quit]
    
        close #profit
    
    end
    
     
  3. Unread #2 - Oct 17, 2009 at 11:26 PM
  4. Jimmy
    Joined:
    Jun 24, 2008
    Posts:
    2,421
    Referrals:
    10
    Sythe Gold:
    25

    Jimmy Ghost
    Retired Sectional Moderator $5 USD Donor

    Basic Profit Calculating Program

    Who still codes in BASIC?
     
  5. Unread #3 - Oct 18, 2009 at 5:13 AM
  6. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    Basic Profit Calculating Program

    Next to nobody.

    Move on to something else or you'll regret it later if you aim to continue programming as either a hobby or a career. BASIC is only good for basic things (no pun intended). You can't use it for much else than what you've got there unless you're using something like Microsoft's Visual Basic on the .Net platform. I recommend moving on to something slightly more complicated yet quite a bit more useful. C#, Java or even Python perhaps.
     
  7. Unread #4 - Oct 19, 2009 at 7:31 PM
  8. Rohail
    Joined:
    Jun 11, 2009
    Posts:
    2,751
    Referrals:
    2
    Sythe Gold:
    0

    Rohail The MiddleMan
    Banned

    Basic Profit Calculating Program

    Basic as in Visual basic?
     
  9. Unread #5 - Oct 19, 2009 at 9:45 PM
  10. Jimmy
    Joined:
    Jun 24, 2008
    Posts:
    2,421
    Referrals:
    10
    Sythe Gold:
    25

    Jimmy Ghost
    Retired Sectional Moderator $5 USD Donor

    Basic Profit Calculating Program

    No, basic as in http://en.wikipedia.org/wiki/BASIC, although Visual Basic does inherit stuff from BASIC (although Visual Basic shouldn't be learned either, as it is over 10 years old and is no longer supported by Microsoft NOTE: VB.NET is not the same as VB6).
     
  11. Unread #6 - Oct 20, 2009 at 11:36 AM
  12. Y0u_G0t_Pwn3d
    Joined:
    Feb 11, 2007
    Posts:
    1,478
    Referrals:
    0
    Sythe Gold:
    0

    Y0u_G0t_Pwn3d Guru

    Basic Profit Calculating Program

    I did this cause I had the program sitting around on my flash drive, I had to reset my PC cause it was crashing and I havent Got VB or the Microsoft C# on my Laptop yet.
     
  13. Unread #7 - Nov 2, 2009 at 4:40 PM
  14. iDesignLogos
    Joined:
    Oct 12, 2009
    Posts:
    514
    Referrals:
    0
    Sythe Gold:
    0

    iDesignLogos Forum Addict

    Basic Profit Calculating Program

    I use blue j. Is that okay?
     
< Ultima online 3rd party | how make rs scripts and like that >

Users viewing this thread
1 guest


 
 
Adblock breaks this site