C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
Question
Book Icon
Chapter 8.4, Problem 2E
Program Plan Intro

Program Plan:

  • Include library files for various operations.
  • Declare required variables.
  • Declare object of ifstream.
  • Declare function header, fcheck()with object of ifstream as a formal parameter.
  • Declare afunctionfcheck()to check that the file exits or not.
  • Useif statement to check that the file exist.
  • Open the file, by using open() method.
  • int main() function is used to perform all the tasks.
  • Display the calculated results to the user.

Program Description: The main purpose of the program is to declare a function, fcheck()to check that the given file exits or not and if the file exist, then function should return 1 otherwise it will return 0.

Blurred answer
Students have asked these similar questions
How should I answer the following regarding the first main function?
Using the code and the function above
4. What does this function return? Which principle does it illustrate?
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning