here is what I need and I am completely stumped on what to do. I ususally do 
not have a problem doing this. but this one is just killing me.

Programming a Personal Budget Program Write a program for a personal budget

that satisfies these conditions:

. The program should have the following command menu selections: Add New

Expense, Remove Expense, Add New Income, Remove Income, Exit

e The Add New Expense command will prompt the user for the amount of the

expense and the frequency of the expense per month. The total monthly

expense of an item is its expense multiplied by its monthly frequency. The total

initia! budget for monthly expenses is $4,000. If the new expense exceeds what

is left for monthly expenses, the program should display a message that the

expense was rejected because the budget was exceeded. If the expense can be

covered by the monthly budget, the program should display a message that the

expense was accepted and state the budget left after the expense.

. The Remove Expense should prompt the user for the expense amount and its

monthly frequency. tf the expense amount to be removed exceeds whatever

has been used of the current budget, then a message should be displayed to

recheck the expense amounts. Otherwise the remaining budget will be

increased by the amount of the expense reduction and a message displayed

stating the amount of the currently available budget funds.

~

. The Add New Income option will prompt the user for the amount of the

increase in monthly income and increase the monthly budget by that amount. A

message will be displayed indicating the amount of the new available funds.

. The Remove Income option will prompt the user for the amount of reduction in

monthly income. If the reduction exceeds the available funds, then print a

message indicating the amount owing. Otherwise, set the budget to the

difference and print the amount of funds available.

"

c) Programming a Personal Budget Program

addExpense( )

removeExpense( )

addRevenue( )

removeRevenue( )

3. All projects should implement a While loop in their code to display the 
command selection

menu. The While loop should use== a variable* called choice to capture the 
user's menu selection.

The While loop should test to see what value the variable choice has to 
determine which menu

 

Programming a Personal Budget Progra'm

/ /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
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to