Posts

Showing posts from September, 2024

File handling with C++ Programming

Image
Learn File handling with the following sample code You are to write a program that reads in lines of input using scanf or cin, and file redirection, process the data, and then output the results using printf or cout. This means you can use C or C++ style I/O as is your personal preference. Name your file lab1assignment.cpp. Failure to name the file correctly may lead to a grade of zero. The data file used in the example is available at: ~dmk0080/public/1040/labs/one.or in the Cavans assignment. Use the file named "transactiondata Use command line redirection to execute as in ./a.out angle bracket transactiondata" to compile use g++ labassignment1.cpp to create the executable file a.out The Data: Each line of th named "transactione data file begins with an 'e', 'c', or 't'. Lines beginning with 'e' will have an integer employee ID and an employee name. Lines beginning with 'c' will have an integer custo