#7 Pre-defined Functions

#7 Pre-defined Functions - Mapua Institute of Technology...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Mapua Institute of Technology School of Information Technology CS103 Fundamentals of Problem Solving and Programming 1 Lecture #6 Functions - Predefined What is a function? Before we answer that question, first imagine for example the following scenario. Let us assume that you were a programmer and you were asked to write a program that will be used to handle Automated Teller Machine transactions. Such transactions include: (1) balance inquiry, (2) deposit and say (3) withdrawal. Aside from these, the user should be presented a menu showing these transactions as possible options. For a non-trivial program like these, it is not advisable to write the codes under one main() program. It is better to subdivide the program into smaller portions which we will call functions. Each function should be able to solve part of the bigger problem. In the scenario above, one function will handle the generation of the menu, another function will be in-charge of handling the balance inquiry, another...
View Full Document

This note was uploaded on 06/14/2011 for the course COMPUTER 091 taught by Professor Rajivsir during the Summer '11 term at MIT.

Page1 / 2

#7 Pre-defined Functions - Mapua Institute of Technology...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online