a.
- Include library files for various operations.
- Declare object ofofstream.
- Create a statement to open the write data to the file “employee.dat”.
- Use if statement with fail() method to check that the entered file name is available or not.
- int main() function is used to perform all the task.
- Display the calculated results to the user.
Program Description: The main purpose of the program is to create a text file, “employee.dat” and to write the given data to the file.
b.
Program Plan:
- Include library files for various operations.
- Declare objects ofifstream and ofstream.
- Declare required variable.
- Create two statements to open “employee.dat” and “employee.bak” file.
- Use if statement with fail() method to check that the entered file name is available or not.
- int main() function is used to perform all the task.
- Display the calculated results to the user.
Program Description: The main purpose of the program is to modify the program code of part (a) so that the program code can create a duplicate copy of the text file with the name “employee.bak”, that contains all the data of “employee.dat” file.
c.
Program Plan:
- Include library files for various operations.
- Declare objects ofifstream and ofstream.
- Declare required variable.
- Read file names from the user.
- Create two statements to open “employee.dat” and “employee.bak” file.
- Use if statement with fail() method to check that the entered file name is available or not.
- int main() function is used to perform all the task.
- Display the calculated results to the user.
Program Description: The main purpose of the program is to modify the program code of part (b)so that the program code will read the name of the original and duplicate file from the user, creates a duplicate copy of the text file with name “employee.bak”, that contains all the data of “employee.dat” file.
d.
To find the better method for accepting the original and duplicate filenames in the program.
Trending nowThis is a popular solution!
Chapter 8 Solutions
C++ for Engineers and Scientists
- Pattern RecognitionPCA algorithmplease write the steps not only last answerarrow_forwardPlease original work Final Project: Part I Background Information: E-TechMart, established in 2005, has grown to become a leading global electronics retailer, renowned for its extensive range of electronic devices and accessories. With a robust online platform and numerous brick-and-mortar stores spread across various regions, E-TechMart serves millions of customers worldwide. The company's product offerings include the latest smartphones, laptops, tablets, smart home devices, and a variety of electronic accessories, catering to both individual consumers and businesses. E-TechMart has always prioritized customer satisfaction and aims to provide an exceptional shopping experience. This commitment is evident in their comprehensive customer service, competitive pricing, and a well-organized loyalty program that rewards repeat customers. Despite these strengths, E-TechMart faces increasing competition from other major players in the electronics retail market. To maintain its competitive…arrow_forwardCan you show me how to redesign the GameStop website using HTML and CSS using Sublime Text?arrow_forward
- Manhattan distancearrow_forwardAiwhat cost from Oradea to Goal which Eforie us A* Algorithm G(n)+H(n) last what ıs the costarrow_forwardWhat is the SELECT statement? give one reference with your answer What is a URL and what is it used for? give one reference with your answer What is e-mail, and what are its advantages? Give one reference with your answerarrow_forward
- What is the difference between the World Wide Web (WWW) and the Internet? Give two references from a journal along with your answer.arrow_forwardDiscuss with appropriate examples, the types of relationship in a database. Give two references from an article.arrow_forwardWhat is a cloud and why do we use it? Give one reference with your answer.arrow_forward
- What are triggers and how do you invoke a trigger on demand? give one reference with your anwer.arrow_forwardWhy is database normalization important? Give one reference with your answer.arrow_forwardDescribe the role of databases and database management systems in the context ofenterprise systems. Give two references with your answer.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education