answersLogoWhite

0


Best Answer

====

'-----------------------------------------------

'*** PROGRAM: Main Menu

' LANGUAGE: QBASIC: VERSION: QB64

'-----------------------------------------------

'------------------------------------------

'*** Global variable declarations list...

'------------------------------------------

userKeyPress$=""

'-----------------------

'*** Main Program...

'-----------------------

DO 'this is a menu driven program...

GOSUB clearScreen

GOSUB printMainMenuTitleHeading

GOSUB printMainMenuOptionsList

GOSUB printMainMenuInstructionsHeading

GOSUB printMainMenuUserInstructions

GOSUB awaitUserKeyPress

GOSUB checkUserKeyPress

LOOP UNTIL UCASE$(userKeyPress$) = "Q" '...UCASE converts lower case to upper

END '...END of program/halt program code execution

'----------------------

'*** Sub-routines...

'----------------------

clearScreen:

CLS '...(CL)ear the output (S)creen

RETURN

printMainMenuTitleHeading:

PRINT "MAIN MENU"

PRINT "========"

RETURN

printMainMenuOptionsList:

PRINT "Hit key: <1> for Program 1: 12 X Tables Square"

PRINT "Hit key: <2> for Program 2: Select a times tables to print out"

PRINT

PRINT "Hit key: <Q> to Quit!"

PRINT

RETURN

printMainMenuInstructionsHeading:

PRINT "USER INSTRUCTIONS"

PRINT "=============="

RETURN

printMainMenuUserInstructions:

PRINT "In order to select from the above Main Menu options list..."

PRINT

PRINT "First, chose the type of program you wish to run..."

PRINT "by, carefully, reading it's description."

PRINT

PRINT "Then, hit a corresponding single number/letter key, either: '1'/'2';"

PRINT "or, alternatively, hit key: 'Q' to Quit!"

PRINT

PRINT "-Thank you!"

RETURN

awaitUserKeyPress:

DO '...keep looping until when user presses any key...

userKeyPress$ = INKEY$ '...store any IN-coming KEY press

LOOP UNTIL userKeyPress$ <> ""

RETURN

checkUserKeyPress:

IF userKeyPress$ = "1" THEN GOSUB program1 '...GO to named SUB-routine

IF userKeyPress$ = "2" THEN GOSUB program2 '...GO to named SUB-routine

RETURN

program1:

GOSUB clearScreen

PRINT "PROGRAM 1"

'(...program 1/code goes here...)

GOSUB awaitUserKeyPress

RETURN

program2:

GOSUB clearScreen

PRINT "PROGRAM 2"

'(...program 2/code goes here...)

GOSUB awaitUserKeyPress

RETURN

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write main menu pseudo code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the code for creating a menu on pascal?

Well if you want to create a menu, you may use CASE.This is the programprogram Menu;var menu:integer;beginwriteln('Menu');writeln('1. XXXXXXX');writeln('2. XXXXXXX'); {unlimited option you want}writeln; {just to make it pretty :)}write('Mode you want to choose');readln(menu);CASE menu OF1: {program if I choose 1 from the menu};2: {program if I choose 2 from the menu};end; {end of case}readln;end.


What is the difference between a pop up menu and a pull down menu?

Pop up menu: This menu can be displayed anywhere on the page with a right-click of the mouse.Pull down Menu: This menu can be displayed when you click or bring mouse on menu then list of sub menu will be displayed under the main MENU.


Menu driven program in c programming?

You can find the source code of the menu driven graphics program here: http://www.start2code.com/Cresources/menu-driven-graphics-program-c.html


How do you create a menu editor in visual basic 6.0?

Men editor is a most important feacture of any application that enables a large number of commands in a small area. Visual basic provides to creating menu editor in our application. The following step is used to create a menu editor in visual basic 6.0-Click on the 'Tools' menu of VB application window.Select menu Editor from this.A dialogue box is appear. Here we named the menu, named its caption select shortcut for the menu.After doing this click on ok to create your menu.Then after from your menu we select it to write code or event to it for perform a specific operation


How do you make menu using jcreator in java?

Currency Source Code Using JCreator

Related questions

Where is the ATV off road fury cheat code menu?

The menu for cheat code entery on ATV Off Road Furry 2 is in the options menu on the main title. (main menu.)


How do you get to the chaets menu in nfs carbon?

There isn't one... Go to the main menu (the one after the title screen) enter the code at the main menu.


Where is cheat code menu in NFS carbon ps2?

just type it on the main menu


What is the code for castleminer z?

its at the bottom of the main menu in the first castleminer.


Where do you type the access code for B-Cubed?

On the main menu, you can click "access code" and enter the 6-digit code.


What are the codes for squared away?

My answer is the code is Pants. If you type it in at the main menu you will get an extra life.


Where in the menu do you put the cheats in for need for speed carbon?

Nowhere. You see, you enter it on the main menu, like infinte nos is: left up left down left down right square on ps3. There is no special menu. you just enter your code on the MAIN menu literally.


How do you enter a code for NBA 2K11?

In the main menu in option you select codes and just enter it.


Where is the code entry in Avatar the Last Air Bender?

At the main menu, go to Extras and then to Codes


What is the code to get five in black ops?

The code to get the zombie map "FIVE" is: "3ARC UNLOCK". You enter that code in the main menu when you break free from the torture chair.


How do you write a menu?

Well... I am going to answer this question as how to write / set up a menu.... 1: starter or 'entrance' dish 2: Main Course 3: Pudding/ dessert For example: My Starter: Soup Main Course: Spicy Pasta Pudding/ dessert: Apple Crumble


Where do you use black ops prestige eddition code?

go on the consoles main menu and select redeem code it explains the rest from that point on