MIS 304 Study Guide - Midterm Guide: While Loop, Code Reuse, Duplicate Code

76 views2 pages

Document Summary

Argument: piece of data passed into a function when called | parameter: variable that receives data passed into a function. Value-returning function: executes its statements then returns a value back to the part of that called it (return causes value to be sent back to part of the program that called the function) Local variable: (cid:272)a(cid:374) o(cid:374)l(cid:455) (cid:271)e (cid:862)see(cid:374)(cid:863) withi(cid:374) the fu(cid:374)(cid:272)tio(cid:374) | global variable: (cid:272)a(cid:374) (cid:271)e (cid:862)see(cid:374)(cid:863) (cid:271)(cid:455) all fu(cid:374)(cid:272)tio(cid:374)s i(cid:374) a progra(cid:373) (cid:894)(cid:272)a(cid:374) (cid:271)e used (cid:271)(cid:455) a(cid:374)(cid:455) fu(cid:374)(cid:272)tio(cid:374)(cid:895) Using global variables is a bad idea because it makes debugging difficult, functions using global variables usually depend on those variables, global variables make programs hard to understand. Solution: create local variables and pass them as arguments to other functions. Global constant: global name that references a value that cannot be changed during a program execution (avoids problem of global variables)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents