Mid Program Sums

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
PokeProgrammer

Mid Program Sums

Post by PokeProgrammer »

I need help! How can I create a program that reads one of my numbers that i have put in and reads one from a variable? Please help as i am trying to make a virtual bank
RayBritton
Veteran
Posts: 109
Joined: Thu Feb 10, 2005 12:38 pm

Post by RayBritton »

try something like for withdrawing money (my programming style is bad)

Code: Select all

withdraw:
variable1=1000 'this is how money in bank
input ">",variable2 'how much they want to withdraw
if variable2 > variable1 then 
        print "Not enough money" 
        sleep  'waits for input
        goto withdraw
else 
      variable1-variable2
      print "You have "variable1" left."
end if
if that was anthing like what you were after
if you could please explain a little more i could probably help more
y12

Reads variable and input?

Post by y12 »

Is this what you mean?

<pre>
'$include: 'c.txt'
rem just wanted it to be there
variable1=88888 'Read variable
input n 'Reads text inputed as variable 'n'

</pre>
Post Reply