Chris Trimble Unit 4 - Research Assignment

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Chris trimble

Unit 4 Research Assignment

Five advantages of using global variables.


It is accessible to all the modules in a program
You only have to declare it once outside the modules
It is good to use it for constants you want to keep consistant
It simplifies maintenance, avoids duplication of local constants.
It can make a program easier to read in reference to constants.
Five disadvantages of using global variables.
It makes debugging difficult
Any statement in a program can change the value
If modules use global variables it is dependent upon the module and if other
modules are presented you have to redesign all over each time
It makes a program hard to understand since it can be modified and have to be
aware of all other parts of the program that access it.
Global variables are not writing direct into flowcharts
Variables Flowchart
In order to declare global variables in a flowchart, you'd put that variable in the
main part of the program (the main box where other functions will branch off from).
For local variables, you'd put those variables in the box where each separate
functions are executed.
Variables - Pseudocode
In Pseudocode, you Declare your local variables and Call, or refer to Global variables

You might also like