In your own words discuss similarities and differences between a function and a small program.
What will be an ideal response?
A function definition is like a small program. Differences are that a program uses input, say cin, for input, or an fstream object, whereas a function uses parameters for inputs. Similarities are many. A program uses cout for output to the screen. A function can use cout to output to the screen. The function can return a value to the caller using a return statement. The program can, in fact, do this too, but such values can only be success codes. The function and the program each have bodies of code that call other functions and do computation to produce the values to satisfy specified. Each has local variables that are declared within the body. Finally, each can use global constants and variables (which are declared outside any function.)
You might also like to view...
A constructor cannot:
a) be overloaded. b) initialize variables to their defaults. c) specify return types or return values. d) have the same name as the class.
The ____ in a flowchart is the process symbol.
A. parallelogram B. rectangle C. diamond D. oval
A three-phase commit protocol has the following parts: Phase 1: is the same as for two-phase commit. Phase 2: the coordinator collects the votes and makes a decision; if it is No, it aborts and informs participants that voted Yes; if the decision is Yes, it sends a preCommit request to all the participants. participants that voted Yes wait for a preCommit or doAbort request. They acknowledge preCommit requests and carry out doAbort requests. Phase 3: the coordinator collects the acknowledgments. When all are received, it Commits and sends doCommit to the participants. participants wait for a doCommit request. When it arrives they Commit. Explain how this protocol avoids delay to participants during their ‘uncertain’ period due to the failure of the coordinator or other participant
What will be an ideal response?
OpenOffice Writer's ________ feature can be used to create documents such as mailing labels and print envelopes
Fill in the blank(s) with correct word