ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 26 May 2017 My Price 8.00

Create a string variable

You may have several data files which can be used by a program, and it would be a shameto have to change your program code every time and have to recompile it just in order torun it on a different data file. In such circumstances, it is better to allow the user to inputthe file name while the program is running. In this part, you will do that.Create a string variable which can hold the file name. Insert statements into your programwhich prompt the user to input a filename, then read from keyboard the name of the datafile. Then add the necessary code to associate the ifstream object with the file whoseCreate a new input file (testdata_2.txt for example). You must do this in a plain texteditor (e.g. TextPad, NotePad, Notepad++, TextEdit, etc.) Run the program and whenprompted, give the name of the new file as the filename. Run it on your old filetestdata.txt also and make sure the program is working well.The user may also be prompted in the same manner for the name of an output file to create.Add code that allow the user to enter the name of the output file. Test your program and make sure everything is working well.

 

65000.8536548.00100358.65300000.0043200.8986399.0086400.25

Attachments:

Answers

(11)
Status NEW Posted 26 May 2017 09:05 AM My Price 8.00

-----------

Not Rated(0)