Given the following, write a code SEGMENT that does the following:   Creates a string variable to store a file name (to be entered by the user) Requests the input file name from the user and stores the name in a variable Opens the input file using the entered file name Tests the STATE of the file open. If the file does not open, output a message to the user exit the program   Be sure to: Include the necessary header files Declare necessary variables

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 9PP: (Inventory) Create an ASCII file with the following data, or use the shipped.dat file available on...
icon
Related questions
Question
    1. Given the following, write a code SEGMENT that does the following:

 

  1. Creates a string variable to store a file name (to be entered by the user)
  2. Requests the input file name from the user and stores the name in a variable
  3. Opens the input file using the entered file name
  4. Tests the STATE of the file open. If the file does not open, output a message to the user exit the program

 

Be sure to:

  1. Include the necessary header files
  2. Declare necessary variables
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage