assn7 - You will also have to use conditional statements to...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
MIT OpenCourseWare http://ocw.mit.edu 6.096 Introduction to C++ January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.096: Introduction to C++ IAP 2009 PROBLEM SET 7 Note: It would be helpful to read the additional notes given at the end of Lecture notes for Lecture 9 before doing this lab. Total : 40 points (8+16+8+8) 1. Create two textfiles FILE1.TXT and FILE2.TXT. Store the following content in these two textfiles: File 1: Hello I C++ File 2: World Love 2. Create another Textfile FILE3.TXT, which contains the text of FILE1 merged with that of FILE2 in the following way: Hello World I Love C++ To do this, create 3 separate objects – 2 in input mode and one in output mode.
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: You will also have to use conditional statements to check for the ends of files. 3. Now add the following content to your existing textfile: a) I Love 6.096 too! b) Several more lines added by the user (inputting should continue as long as the user wishes – ask the user after every line he/she inputs!) 4. Finally, count and print: a) The number of occurrences of the letter ‘O’ in your file File 3.txt. b) The number of occurrences of the word “Love” in your file File3.txt (You can use the strcmp() function of file cstring here, or compare using string objects, with which you can use the == operator)...
View Full Document

This note was uploaded on 11/14/2011 for the course DDDD h0322 taught by Professor Whoknow during the Spring '11 term at Bina Nusantara University.

Page1 / 2

assn7 - You will also have to use conditional statements to...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online