Solved

QBasic Grading Program - Loop Input Options

Posted on 2003-11-18
5
653 Views
Last Modified: 2006-11-17
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
Comment
Question by:demise146
  • 2
5 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
ID: 9776444
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
 

Author Comment

by:demise146
ID: 9776496
It worked when i put the loop after the end select statement...thanks so much for your quick response!!!
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9776619
gr8
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9776737
demise146 : can you accept sunny's answer and close the question?
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question