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

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 5RQ
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage