Page 1 of 1
Qbasic Help Needed
Posted: Mon Dec 05, 2005 12:22 pm
by grahamcrackerz123
Hello,
I am an aspiring game developer in high school. I was wondering if you could show me where I could find a very simple calculator that does the basics (+,-,*,/)
Thank you,
Graham

Posted: Mon Dec 05, 2005 12:31 pm
by Guest
look in the file areas here theres got to be 1....
Posted: Mon Dec 05, 2005 1:07 pm
by Patz
Code: Select all
'PQBC Calculator - Derived from an old PQBC program called
'ROS2004 (Replica Operating System 2004) at age 12
CLS
Print "Simple Calculator - PQBC"
Print STRING$(80,196)
Print "1-Add 2-Subtract 3-Multiply 4-Divide"
Input "Operation to use? ", oper
Input "First Number: ",num1
Input "Second Number",num2
Select Case oper
Case 1
Let ans = num1 + num2
Case 2
Let ans = num1 - num2
Case 3
Let ans = num1 * num2
Case 4
Let ans = num1 / num2
Case Else
Print "Invalid operation number. Please use numbers 1-4."
End Select
Print "Answer: ";ans
END
See if that helps. It should be easy to turn into a function.