Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help with the work, thank you File Input/Output in C++ Winclude //header file for file I/o ifstream inFile: file ofstream outFile: (names of your

image text in transcribed

Please help with the work, thank you

File Input/Output in C++ Winclude //header file for file I/o ifstream inFile: file ofstream outFile: (names of your choice) //declare input and output stream variables /I0pen the input fi with input file stream variable) inFile.open ("h: Idoublevalue.txt") //open non-existent output file or existing output file. outFile . open ("h:Wnea rest int . txt", le (associate file name and location append new output to ios : : app o use input file stream variable inFile (instead of never input is from a file and not from the /* (Now cin) whe keyboard. Examples are: inFile > value; inFile.get (ch) : inFile.ignore 25, '' getline (inFile, str) Use the outp cout) to output strings of text and variable values to the output file.) //Close input and output inFile.close() outFile.close) files Lab Assignment: Write a program to convert floating point to the nearest integer using file input and output. The output should identify both the input value and the rounded value, in a sentence. The input file must exist, with the data in it, before you run the program. Run once with input data value of 243.78. Then open the input file and change the data in it to an input data value of 94.375. After you run the program again, the output file should contain the results of both runs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions