Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 680
  • Last Modified:

QBasic Grading Program - Loop Input Options

The following is the input prompt...all 4 subprograms work.  I need the Option input question to loop after each selection until the "quit" selection is chosen...can someone please tell me how to do this?


PRINT "PLEASE CHOOSE AN OPTION BELOW (1 - 4)"
PRINT "====================================="
PRINT " "

PRINT "    1.  ALPHABETIZE THE ROSTER"
PRINT "    2.  AVERAGE THE NUMBER GRADES"
PRINT "    3.  CALCULATE THE LETTER GRADES"
PRINT "    4.  QUIT"
PRINT " "
INPUT "WHICH OPTION DO YOU CHOOSE"; OPT
PRINT " "
SELECT CASE OPT
CASE 1
CALL ALPHABET
CASE 2
CALL AVERAGE
CASE 3
CALL LETTER
CASE ELSE
PRINT "YOU HAVE CHOSEN TO QUIT.  THANK YOU FOR USING THIS PROGRAM."
END
END SELECT
END

 
0
demise146
Asked:
demise146
  • 2
1 Solution
 
sunnycoderCommented:
DO
    PRINT "PLEASE CHOOSE AN OPTION BELOW (1 - 4)"
    PRINT "====================================="
    PRINT " "

    PRINT "    1.  ALPHABETIZE THE ROSTER"
    PRINT "    2.  AVERAGE THE NUMBER GRADES"
    PRINT "    3.  CALCULATE THE LETTER GRADES"
    PRINT "    4.  QUIT"
    PRINT " "
    INPUT "WHICH OPTION DO YOU CHOOSE"; OPT
    PRINT " "
    SELECT CASE OPT
    CASE 1
    CALL ALPHABET
    CASE 2
    CALL AVERAGE
    CASE 3
    CALL LETTER
    CASE ELSE
    PRINT "YOU HAVE CHOSEN TO QUIT.  THANK YOU FOR USING THIS PROGRAM."
LOOP UNTIL OPT = 4
END
END SELECT
END
0
 
demise146Author Commented:
It worked when i put the loop after the end select statement...thanks so much for your quick response!!!
0
 
sunnycoderCommented:
gr8
0
 
bhagyeshtCommented:
demise146 : can you accept sunny's answer and close the question?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now