Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help on computer science, to write c++ program(Visual Studio) please!!! 1 Purpose This is another program for reading from files. In this program we
Need help on computer science, to write c++ program(Visual Studio) please!!!
1 Purpose This is another program for reading from files. In this program we will read blocks of data from a (well-formatted) file that you will be given and make some computations on that data The input file will be formatted as described later in this document. It will be similar the "block" data from Lecture 11. 2 Procedure You will create one source code program. Prog06.cpp. This program will 1. Prompt the user for an input filename. Store the filename as a string object. See Lectures 10 and 11. Then prompt the user for an output filename. Store it the same way 2. open the input filename for reading. Open the output filename for writing with append. If you cannot open the filenames the user supplied, prompt the user for two more. Repeat this until you can open the user's files. I found that if you want to use just the plain file name, the file should be placed the directory where Visual Studio puts the vcxproj" file and the cpp" file. Otherwise you have to give the FULL path to the file. If you put the file on the Desktop, the filename will be something e like C: Musers your user name Desktoplyour real-file name 3. Once the file is open, read in blocks of data until one of two things happens You reach the end of the file. The block you read in has an ID number of 0 1 Purpose This is another program for reading from files. In this program we will read blocks of data from a (well-formatted) file that you will be given and make some computations on that data The input file will be formatted as described later in this document. It will be similar the "block" data from Lecture 11. 2 Procedure You will create one source code program. Prog06.cpp. This program will 1. Prompt the user for an input filename. Store the filename as a string object. See Lectures 10 and 11. Then prompt the user for an output filename. Store it the same way 2. open the input filename for reading. Open the output filename for writing with append. If you cannot open the filenames the user supplied, prompt the user for two more. Repeat this until you can open the user's files. I found that if you want to use just the plain file name, the file should be placed the directory where Visual Studio puts the vcxproj" file and the cpp" file. Otherwise you have to give the FULL path to the file. If you put the file on the Desktop, the filename will be something e like C: Musers your user name Desktoplyour real-file name 3. Once the file is open, read in blocks of data until one of two things happens You reach the end of the file. The block you read in has an ID number of 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started