1 / 6

File input and output

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

osman
Download Presentation

File input and output

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. File input and output

  2. 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.

  3. 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

  4. 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

  5. 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?

  6. 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.:

More Related