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
(C++ Language) Create a function that writes to a file named Inventy.txt the information of 8 items. Ask the user for the item's name, the item's quantity in storage, and the item's price and write it to the file. Create a function that reads the file and items' quantity and price to two different arrays. Create a function that computes the subtotal of each item. Implement all functions inside the main program and the computed value should be displayed with the item's name.
(C#)The following statement declares a StreamReader object variable called "inputFile". Which statement opens a file named "data.txt" to the StreamReader object?StreamReader inputFile;   Question 10 options:   inputFile = open("data.txt");   inputFile = OpenFile("data.txt");   inputFile = File.OpenFile("Data.txt");   inputFile = File.OpenText("Data.txt");
C++ Programming. Topic: Working with pointers and dynamic memory. Indicators. Working with dynamic memory. Dynamic arrays and their use as function parameters. Task : Describe a void function named Swap(x,y) that swaps the values ​​stored in the variables x and (x is a real type parameter and is both input and output). Using this function , for the given variables of real type a, b, c, d, one should sequentially replace the values ​​of the pairs (a, b), (c, d) and (b, c) and let a, b, c, d be new values ​​.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education