Solved

QBasic Grading Program - Loop Input Options

Posted on 2003-11-18
5
668 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This is about my first experience with programming Arduino.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

632 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