Question

This assignment uses functions, files, and strings. Enough flexibility is provided for you to apply your...

This assignment uses functions, files, and strings. Enough flexibility is provided for you to apply your knowledge of basic C++ programing to develop your solution. Develop a functional flowchart and then write a C++ program to solve the following problem.

1. Create a text file named file1.txt and write your brand of car (like Honda, Toyota, etc) in the file. You will be reading the name of the file from the keyboard as a string, using the string class. Your program will also read the brand of your car from the keyboard. The process of the file creation (name of the file, mode for opening the file, and testing the open success is done in a user-defined function. The function communicates the status of file open to the calling function).

2. Create a text file named file2.txt and write your car model in the file. You will be reading the name of the file from the keyboard as a string, using the string class. Your program will also read the model of your car from the keyboard. The process of the file creation (name of the file, mode for opening the file and testing the open success is done in a user-defined function. The function communicates the status of file open to the calling function)

3. Create a text file named myCar.txt and write the brand of your car from the file file1.txt, and the model from file file2.txt. You will be reading the name of the file from the keyboard as a string, using the string class. The process of the file creation (name of the file, mode for opening the file and testing the open success is done in a user-defined function. The function communicates the status of file open to the calling function)

4. At this time, each file will have one line of text in it.

5. Prepare the files for reading.

6. Display the results of the three files in the order shown below:

File1.txt your brand of car as written in the file1

File2.txt your model of the car as written in the file2

myCar.txt your car brand and the model as written in myCar

Note that there is a single space between the car brand and the car model when you display the contents of the file myCar.txt. You will use a user-defined function to display all the files at once or one at a time.

7. Close all files. You will use a user-defined function that closes each file separately or all at once.

8. Run the program again and use your choice of the filenames, and different names, different than what you used above and repeat the process.

do not use stdio.h and conio.h

using visual studio 2015

related to book 'A first book of C++"

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
This assignment uses functions, files, and strings. Enough flexibility is provided for you to apply your...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT