Global Variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ron Schleimer
    New Member
    • Nov 2011
    • 2

    Global Variables

    For a school project, I have to write a budget calculator that will give a menu of adding expenses, removing expenses, adding income and removing income. I have written each a module within my program. And I have the main module saying the original total budget is $4000. How would I make it so that if I were to add or remove from this amount, the other modules would be able to use this adjusted amount?
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    How would I make it so that if I were to add or remove from this amount, the other modules would be able to use this adjusted amount?
    They would have to have access to the container that holds this amount. I would use a class instance variable so it would be visible throughout the class.

    Comment

    Working...