Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.


This page removed for FERPA compliance
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Final Exam Review Spring 2004: Questions on Functions

Link back to Sp2004 Final Exam Review

Questions and Answers?



1)
~easier to read code
~debugging purposes/procedural abstraction (can test individual functions at a time)
~can write REMOVED code in less space

2) procedural abstraction is when you define high level functions that call lower level functions

Anything about reuse in there? Mark Guzdial

2. What is procedural abstraction?
(pg 203) defining functions (procedures) instead of lines of code. Define high-level fxns. That call lower-level functions. Lower level fxns r easy 2 write and test, higher level fxns become easy 2 read b/c they’re simply calling lwr level fxns.

(pg305) Alan Kay- REMOVEDppourt REUSE b/c each obj. would provide services 2 other objects
(typo in book p. 305-missing B in objects)
(tasks that the object would do 4 other objects, accessible thru its methods)-just as real world objects do.Mireille Murad
REMOVED out the functions lecture. There are some real clear (like, NUMBERED) reasons there... Mark Guzdial


3 reasons:
1. Hides details so that you can ignore them 2. Makes testing easier 3. Helps you in writing new programs, b/c u can reuse trusted, useful fxns. Mireille Murad

anyone for number 3 of this question, what is good modularity?!

a modular program has good modularity, because each function does one and only one thing very well

i'm so confused with this question!! :(

2. What is procedural abstraction? You define high level functions that call lower-level functions. You call lower level functions because they are easier to write and test and the higher level functions become easy to read because they’re simply calling lower level functions

I don't know how this is...but it's a start ;) Student1113

It is, but think about procedural abstraction REMOVED as a process for writing programs. Why did you define lower-level functions? Maybe because you decided to break the problem down into lower-level functions? Mark Guzdial


2. Procedural abstraction is stating the problem, breaking the problem into smaller and smaller sub problems until you know how to write a program that solves the smaller problem. The goal is that the main function basically tells all the subfunctions what to do. Each subfunction does one an only one logical task. Allows for easy reuse of functions.

3. Good modularity = each function in the program does one and only one thing. This has value because the functions can easily be reused in new situations.

Student966





Link to this Page