[Tutor] i need help with a code

Alan Gauld alan.gauld at btinternet.com
Mon May 24 10:01:32 CEST 2010


"patricia welch" <patriciaandmikewelch at msn.com> wrote

> here is what I need and I am completely stumped on what to do. 

I'm not quite sure what you are asking us here?

This appears to be a homework excercise? If so the rules of 
the list mean we won't give you an solution but we will try to 
point you towards the answer.

However in this case you appear to have been given the outline 
answer is some kind of weird VB like pseudo code.
So what is your question?

Are you trying to convert the "VB" code into Python?
If so make a stab at it and show us what you've done.

/ /variable declarations:

Declare Integer choice = 0
Declare Real total Budget = 4000

/ /main selection menu
While choice != 5
/ /display menu
Display "Menu Selections:"
Display "1_ Add an Expense"
Display "2 - Remove an Expense"
Display "3 - Add Revenue"
Display "4 - Remove Revenue"
Display "5 - Exit"
Display "Enter your selection:"

Input choice
!/check menu selection
If choice == 1 Then "---./
addExpense( )
Else If choice == 2 Then
removeExpense( )
Else If choice == 3 Then
addRevenue( )
Else If choice == 4 Then
removeRevenue( )
Else If choice == 5 Then
Display "Goodbye!"
Else
Display "Invalid input - please try again."
End If
End While


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list