70 likes | 232 Views
File input and output. File input and output. 'r ' when the file will only be read 'w ' for only writing (an existing file with the same name will be erased ) 'a ' opens the file for appending; any data written to the file is automatically added to the end
E N D
File input and output • 'r' when the file will only be read • 'w' for only writing (an existing file with the same name will be erased) • 'a' opens the file for appending; any data written to the file is automatically added to the end • 'r+' opens the file for both reading and writing. • Themode argument is optional; 'r' will be assumed if it’s omitted.
Classes • Classes allow us to group together related variables and methods into a single coherent data type. • This allows us to more accurately model the things we want to represent in our system, e.g. customers, accounts, books, molecules, etc
Application Development:A contact management application • Command-line interface • Plan • User experience • Data structures and algorithms • Classes, arrays, variables, functions • Storage and retrieval • Implementation • Testing and evaluation
Brainstorm • How does as contact management app work? • What can you do with it? • How can we make that work in a command line interface?
Sample Output • It is useful to imagine what your program will look like when its running • Write a few lines showing exactly how the program will run, e.g.: