Note that there are some explanatory texts on larger screens.

plurals
  1. POMaking a Menu in QBasic
    text
    copied!<p>I am making a simple calculator in QBasic, for that want to implement a Menu, the practice which I followed was: </p> <pre><code>PRINT "Select an Option" PRINT "1. Addition" PRINT "2. Subtraction" PRINT "3. Multiplycation" PRINT "4. Division" PRINT "Option No.: " INPUT opt CLS SELECT CASE opt CASE 1 PRINT "You have selected Addition" PRINT "Enter a no.:" INPUT n1 PRINT "Enter second no.:" INPUT n2 PRINT "The Sum is "; n1 + n2 CASE 2 PRINT "You have selected Subtraction" PRINT "Enter a no.:" INPUT n1 PRINT "Enter second no.:" INPUT n2 PRINT "Difference between "; n1; " and "; n2; " is "; n1 - n2 CASE 3 PRINT "You have selected Multiplycation" PRINT "Enter a no." INPUT n1 PRINT "Enter second no.:" INPUT n2 PRINT "Product is "; n1 * n2 CASE 4 PRINT "You have Selected Division" PRINT "Enter a no.:" INPUT n1 PRINT "Enter second no.:" INPUT n2 PRINT "The Quotient is "; n1 / n2; " and the remainder is "; n1 MOD n2 CASE ELSE PRINT "Invalid Option Number" END SELECT </code></pre> <p>But this time I want a more sophisticated one, like:<br> (A)dd Numbers<br> (S)ubtract Numbers<br> (M)ultiply Numbers<br> (D)ivide Numbers<br> This all in a Box that is centered on the Screen. I am using <code>LOCATE</code>, but I am not getting the results I want, and yes I am trying this without Graphics. I'm also using <code>INKEY$</code> to get the key entered by user. I tried <code>INPUT</code> but it echoed the character typed by user. </p> <p>EDIT: @user2864740, it means that I was not able to get the perfect coordinates.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload