Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

python code help


  • Please log in to reply

#1
ladydaemon

ladydaemon

    New Member

  • Member
  • Pip
  • 1 posts
so here is the whole thing that I need to do and what needs to be done:

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. tfthe 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
  • 0

Advertisements


#2
Father0fNine

Father0fNine

    Member

  • Member
  • PipPip
  • 29 posts
This sounds very much like a homework assignment...

What problems are you having with the code you wrote?
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP