Solved

QBasic Grading Program - Loop Input Options

Posted on 2003-11-18
5
640 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is an explanation of a simple data model to help parse a JSON feed
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now