CSCI 10 Lecture 20: CSCI 10 – Day 20

90 views2 pages

Document Summary

Midterm grades: mean = 80% and median = 86%! Final version of grading program: now with files. Requirement: user should not need to modify code. *keep in mind for your program design that some countries use commas. Michael bannister, 50, 80, 95, xy. z, c // the last two are percentage and for decimal points letter grade. We dump data into (<>) input streams, e. g. cin. Large amounts of data (more than that would fit in ram) File reading/writing is sequential, must be read front to back. Basic operations: open, <>, close and fail. Ways you could fail at opening a file: No permission to read (not to some network resources) Writing to a file ofstream out_stream; if (out_stream. fail()) { out_stream. open(cid:523)(cid:498)output. txt(cid:499)(cid:524); // has to be full directory! cout << (cid:498)failed to open output. txt(cid:499) << endl;

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