BASIC...Not visual

Started by Tazero, December 02, 2011, 04:47:19 am

Previous topic - Next topic

Tazero

So I've been working on a program that will allow me to  calculate an amount money to be shared amongst multiple people based on hours.

As we all know USD currency doesn't go past the "hundreths" place I wonder if theres a way to stop numbers from being posted and rounding down.

My code is
'Stat Profit Sharing Calculator
'By Tyler Roma
'Aka Tazero
'Variable guide:
'yorn$ - for the Yes or No questions, thours - Total Hours
'Shours - Solo/single hours, tmoney - The money to be split between associates
[start]
input "Total hours: "; thours
Print thours
Input "Is this correct? (Y) or (N) Case Sensitive* "; yorn$
If yorn$ = "Y" then goto [totalmoney] else notice "Enter correct amount!"



[totalmoney]
print "Total money to be split"
input ""; tmoney
print tmoney
input "Is this correct?"; yorn$
if yorn$ = "Y" then [solohours] else notice "Enter correct amount"




[solohours]
Print "total hours are "; thours; " hours"
Print "total money to be 'split' "; tmoney; " dollars"
Print "--------------------------------------------------"
input "Number of hours worked for employee "; shours
if shours > thours then notice "Impossible" else goto [calculation]
cls
goto [solohours]

[calculation]
let x = shours / thours * tmoney
Print shours; "/"; thours; "*"; tmoney; "="; x
input "Would you like to enter another amount?"; yorn$
Print "Log updated"
let y = tmoney - x
print y; " is amount left"
print "---------------------------------------------------------------------------------------------------"
if yorn$ = "Y" then goto [solohours] else goto [end]

[end]
end







If you were a fish...

Zeriab

Which version of BASIC is this?
It doesn't look like QuickBASIC and it's not one of the earlier BASIC variants.

Do you want to just round down or do you want to make sure that the sum of all the amounts to be shared to each person is the same as the total amount of money?
If you round down there can be some money left.

*hugs*

Tazero

Its a Dumbed down version of Blitz?
Mmmh... I want the money to equal the amount given above in the tmoney var, but just to the second decimal because this IS money I'm dealing with.


If you were a fish...