CS247 Lecture : CS 247 Spring 2014 First Week Course Notes

87 views3 pages

Document Summary

They are composed with a range of legal values and functions that maniplate variables of a given type. By providing compiler support for these type restrictions, we turn programmer errors into type errors (which are checked by the compiler). One of the main motivations for designing an adt is to ensure safety of any client code. Adts also tend to improve code e ciency by limiting range checks to constructors and mutators. An adt constructor initializes the new object to some legal value and throws an error if the passed-in value is illegal. Accessors and mutators provide restricted read/write access to one of the values in the object. It is best practice to ensure legality within each mutator and use const references whenever possible. We use the outside-in method fo development: rst we determine what the user wants out of it, then we design and implement it.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers