Starting Out With C++: Early Objects (10th Edition)
10th Edition
ISBN: 9780135235003
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 13.1, Problem 13.1CP
Name three different C++ classes that can be used to create input streams.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Kindly provide a list of at least three classes in C++ that may be used to generate input streams.
Help write a C++ Program to do the following:
This is to create a prototype for a Web browser. You’ll do this by transforming the file viewer created (SHOWN BELOW) into a browser for a web of files that are all located on a single computer. (This is in contrast to the real World Wide Web whose pages are located all over the world.) Details The files in this web of files are plain text files that may contain anchors that provide links to other files. More precisely, an anchor is a string of the form 1 where filename is the name of another file and text is a piece of text. For example, here’s a line of text that contains an anchor: More is available. To keep things simple, assume that every anchor is separated from adjacent text by white space and that the strings filename and text cannot contain white space. Your browser should work exactly like the file viewer, except for the following:
1. When an anchor is displayed, it should appear as [n] where n is a number that is unique to…
Write a C program that gets a source file name from a user. If the file does not exist, it will generate a proper error and exits.If the file exists, it also gets the name of two more files from the user, say destination1 and destination2. These files don’t need to exist as they are files that need to be written to.
If the files cannot be opened for writing, a proper error will be generated.
The program then reads the source file line by line. It will copy every line that has a digit in it to destination 2 and lines that have no digit in them to destination 1. Feel free to use ctype’s isdigit() function to identify digit characters.
Example:
If source file is:Hi My name is VeriaHello My name is John. How can I help you?I have a problem with my giga bit internet. The speed should be around 1000 but it’s just 200
Sure! I can help with that.
Can I have your number in case we get disconnected?
Sure! My number’s 647-123-1234
First file (destination 1) should be
Hi My name is Veria
Hello…
Chapter 13 Solutions
Starting Out With C++: Early Objects (10th Edition)
Ch. 13.1 - Name three different C++ classes that can be used...Ch. 13.1 - Name three different C++ classes that can be used...Ch. 13.1 - What is the purpose of the second parameter to the...Ch. 13.1 - Why is it important for a program to close an open...Ch. 13.1 - Which file open flag causes all output to take...Ch. 13.1 - Which file open flag causes the contents of an...Ch. 13.1 - What happens if ios: :out is used by itself to...Ch. 13.1 - What happens if ios::out is used by itself to open...Ch. 13.1 - Write a sequence of C++ statements that reads in...Ch. 13.1 - Write a sequence of C++ statements that reads in...
Ch. 13.1 - Show how to use the constructor of the fstream...Ch. 13.1 - Consider two parallel arrays of the same size, one...Ch. 13.3 - Make the required changes to the following program...Ch. 13.3 - Describe the purpose of the eof member function.Ch. 13.3 - Assume the file input.txt contains the following...Ch. 13.3 - Describe the difference between reading a file...Ch. 13.3 - Describe the difference between the getline...Ch. 13.3 - Describe the purpose of the put member function.Ch. 13.3 - What will be stored in the file out.dat after the...Ch. 13.3 - The following program skeleton, when complete,...Ch. 13.5 - Write a short program that opens two files...Ch. 13.5 - How would the number 479 be stored in a text file?...Ch. 13.5 - Describe the differences between the write member...Ch. 13.5 - What arc the purposes of the two arguments needed...Ch. 13.5 - What are the purposes of the two arguments needed...Ch. 13.5 - Describe the relationship between fields and...Ch. 13.5 - Prob. 13.27CPCh. 13.7 - Describe the difference between the seekg and the...Ch. 13.7 - Describe the difference between the tellg and the...Ch. 13.7 - Describe the meaning of the following file access...Ch. 13.7 - What is the number of the first byte in a file?Ch. 13.7 - Briefly describe what each of the following...Ch. 13.7 - Describe the mode that each of the following...Ch. 13 - Prob. 1RQECh. 13 - Before a file can be used, it must first beCh. 13 - When a program is finished using a file, it shouldCh. 13 - The__________ header file is required for file I/O...Ch. 13 - Prob. 5RQECh. 13 - The_____________ file stream data type is for...Ch. 13 - The____________ file stream data type is for input...Ch. 13 - The ______ file stream data type is for output...Ch. 13 - Write a statement that defines a file stream...Ch. 13 - Write a statement that defines a file stream...Ch. 13 - Write a statement that defines a file stream...Ch. 13 - Write two statements that use the people file...Ch. 13 - Write two statements that use the pets file stream...Ch. 13 - Write two statements that use the places file...Ch. 13 - If a file fails to open, the file stream object...Ch. 13 - Write a program segment that defines a file stream...Ch. 13 - The same formatting techniques used with ______...Ch. 13 - The ______ member function reports when the end of...Ch. 13 - The ______ function reads a line of text from a...Ch. 13 - The _______ member function reads a single...Ch. 13 - The _____ member function writes a single...Ch. 13 - Prob. 22RQECh. 13 - Prob. 23RQECh. 13 - Prob. 24RQECh. 13 - In C++, _______ provide a convenient way to...Ch. 13 - The _______ member function writes raw binary data...Ch. 13 - The _______ member function reads raw binary data...Ch. 13 - The ______ operator is necessary if you pass...Ch. 13 - In _______ file access, the contents of the file...Ch. 13 - In _____ file access, the contents of a file may...Ch. 13 - The _______ member function moves a files read...Ch. 13 - The ______ member function moves a files write...Ch. 13 - The _______ member function returns a files...Ch. 13 - The _______ member function returns a files...Ch. 13 - The ______ mode flag causes an offset to be...Ch. 13 - The ______ mode flag causes an offset to be...Ch. 13 - The ______ mode flag causes an offset to he...Ch. 13 - A negative offset causes the files read or write...Ch. 13 - Give a pseudocode algorithm for determining the...Ch. 13 - Give a pseudocode algorithm for comparing two...Ch. 13 - Prob. 41RQECh. 13 - Suppose that you have two text files that contain...Ch. 13 - Each of the following programs or program segments...Ch. 13 - File Previewer Write a program that asks the user...Ch. 13 - File Display Program Write a program that asks the...Ch. 13 - Punch Line Write a program that reads and prints a...Ch. 13 - Tail of a File Write a program that asks the user...Ch. 13 - String Search Write a program that asks the user...Ch. 13 - Sentence Filter A program that processes an input...Ch. 13 - File Encryption Filter File encryption is the...Ch. 13 - File Decryption Filter Write a program that...Ch. 13 - Letter Frequencies The letter e is the most...Ch. 13 - Put It Back C++ input stream classes have two...Ch. 13 - Prob. 11PCCh. 13 - Insertion Sort on a File II Modify the program...Ch. 13 - Prob. 13PCCh. 13 - Prob. 14PCCh. 13 - Inventory Program Write a program that uses a...Ch. 13 - Inventory Program Write a program that uses a...Ch. 13 - Group Project 17. Customer Accounts This program...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
What is the general problem with static scoping?
Concepts Of Programming Languages
This optional Google account security feature sends you a message with a code that you must enter, in addition ...
SURVEY OF OPERATING SYSTEMS
a. In what way are general-purpose registers and main memory cells similar? b. In what way do general-purpose r...
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Show a snippet of PHP code for displaying the contents of a recordset. Explain the meaning of the code.
Database Concepts (8th Edition)
14. A cube of material X, 1 inch [in] on all sides, has a mass of 0.05 kilograms [kg]. Determine the specific g...
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
Knowledge Booster
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
- Write a program in C++ that merges the content of two files into another file. Complie the code on online compiler .arrow_forwardWrite a C/C++ language program that reads the file numbers.txt and checks each number for being a prime number. Only the prime numbers from these are then written to a text file prime.txt.arrow_forwardTo be done using C programming:Two identical files are given with different names to them. But some characters in the content of the second file are corrupted. Find the line number and their position where those corrupted letter exists as well as Total number of corrupted (error) letters. Examples: Input: File1.txt contains It is fun to code with C File1.txt contains It is fun to code with C# Output: Line Number : 2 Error Position:2 Total Errors:1 Steps Open two file using File pointer in read only mode. Fetch data of file in two char variable one by one until end of file. If variable encounter new line then increment line number and reset position to zero. If variables are not equal then increment number of error and print error line as well as error index.arrow_forward
- Write a C++ program that reads two items from a data file, the bit string itself and the parity required, and then adjusts the bit string and then expresses both the original string and the parity adjusted string in hexadecimal form.Sample Run:Enter the bit string and parity (EVEN or ODD): 10110101 EVENOriginal Hex Value: B5Parity Adjusted Hex Value: 16Barrow_forwardWrite a complete C or C++ program to implement a digital music archive program. The program should be able to allow the following operations through the menu structure. Use FILE to write the outputs, the song directory: Menu: 1- Add a new song to directory 2- Delete a song from the directory 3- List all songs in the directory 4- Search a song: Search according to song name Search according to singer's name А - B 5- Update song information 6- Sort according to song name 7- Sort according to singer's name 8- Quit struct date { int day, month, year; }; struct car { int ID; char songname[100], singersname[30], category[10]; struct date albumdate; }song_directory[100];arrow_forwardWrite a complete C or C++ program to implement a digital music archive program. The program should be able to allow the following operations through the menu structure. Use FILE to write the outputs, the song directory: Menu: 1- Add a new song to directory 2- Delete a song from the directory 3- List all songs in the directory 4- Search a song: A – Search according to ID B – Search according to category 5- Update song information 6- Sort according to ID A - In ascending order B – In descending order 7- Sort according to category in alphabetic order 8- Quit struct date { int day, month, year; }; struct car { int ID; char songname[100], singersname[30], category[10]; struct date albumdate; }song_directory[100];arrow_forward
- Make a C program that gets a source file name from a user. If the file does not exist, it will generate a proper error and exits. If the file exists, it also gets the name of two more files from the user, say destination1 and destination2. These files don't need to exist as they are files that need to be written to. If the files cannot be opened for writing, a proper error will be generated. The program then reads the source file line by line. It will copy every line that has a digit in it to destination 2 and lines that have no digit in them to destination 1. Feel free to use ctype's isdigit() function to identify digit characters. Example: If source file is: Hi My name is Veria Hello My name is John. How can I help you? I have a problem with my giga bit internet. The speed should be around 1000 but it's just 200 Sure! I can help with that. Can I have your number in case we get disconnected? Sure! My number's 647-123-1234 First file (destination 1) should be Hi My name is…arrow_forwardWrite a program that reads movie data from a CSV (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the CSV file and outputs the contents according to the following requirements in c++ : Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator ('|') in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the CSV file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Hints: Use the find() function to find the index of a comma in each…arrow_forwardWrite a complete C or C++ program to implement a digital music archive program. The program should be able to allow the following operations through the menu structure. Use FILE to write the outputs, the song directory: Menu: 1- Add a new song to directory 2- Delete a song from the directory 3- List all songs in the directory 4- Search a song: A – Search according to song name B – Search according to singer’s name 5- Update song information 6- Sort according to song name 7- Sort according to singer’s name 8- Quit struct date { int day, month, year; }; struct car { int ID; char songname[100], singersname[30], category[10]; struct date albumdate; }song_directory[100];arrow_forward
- Write a C++ Allegro program, which runs in Dev C++, which uses only Allegro geometric function calls (no pre-existing bitmaps or graphics files): 1. generates an 800x800 initial black window 2. draws a white hypno-spiral like the below 3. Make sure that the black lines are exactly 5 pixels thick and the white lines are 7 pixels thick. No Archimedes spiral; keep lines parallel linesarrow_forwardWrite a program in c++, that lets the user go through a text file and replace one given character with another, for example change ever occurrence of the letter C to the letter D. Ask the user for the file name to read from and the file name to write to, and ask the user for the letter to be replaced and the new letter.arrow_forwardWrite the following task using the C programming language: Write a C program that counts "the number of occurrences of a specific word" in a previously written text file. The output is the number of occurrences of that specific word (i.e. text file content: I told you to do the dishes but you didn't -> output: The number of occurrences of the word you is: 2)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License