Qbasic Help Needed

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
grahamcrackerz123

Qbasic Help Needed

Post 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 :D
Guest

Post by Guest »

look in the file areas here theres got to be 1....
Patz

Post 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.
Post Reply