Starting Out with C++ from Control Structures to Objects (9th Edition)
9th Edition
ISBN: 9780134498379
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 12, Problem 26RQE
Program Description Answer
A “record” contains a set of data about an item and is made up of “fields”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Built-in arrays, bitset s and valarray s are all__________containers.
A pointer that contains the address O is called a(n) ____ pointer .
The capacity of a vector indicates
A the number of elements it contains
B the number of elements it can currently store
the largest number of elements it can store
the current size of the vector in bytes
Unlike a sequence container, whose elements are organized by index, the elements in an associative container are
organized by
A value
B key
memory location
pointer
Chapter 12 Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Ch. 12.1 - Which file access flag would you use if you want...Ch. 12.1 - Prob. 12.2CPCh. 12.1 - Assuming diskInfo is an fstream object, write a...Ch. 12.1 - Assuming diskInfo is an fstream object, write a...Ch. 12.1 - Assuming diskInfo is an fstream object, write a...Ch. 12.1 - Write a statement that defines an fstream object...Ch. 12.5 - Assume the file input.txt contains the following...Ch. 12.5 - Describe the difference between reading a file...Ch. 12.5 - What will be stored in the file out.txt after the...Ch. 12.10 - Describe the difference between the seekg and the...
Ch. 12.10 - Describe the difference between the tellg and the...Ch. 12.10 - Describe the meaning of the following file access...Ch. 12.10 - What is the number of the first byte in a file?Ch. 12.10 - Briefly describe what each of the following...Ch. 12.10 - Describe the mode that each of the following...Ch. 12 - What capability does the fstream data type provide...Ch. 12 - Which file access flag do you use to open a file...Ch. 12 - Assume the file data.txt already exists, and the...Ch. 12 - How do you combine multiple file access flags when...Ch. 12 - Should file stream objects be passed to functions...Ch. 12 - Under what circumstances is a file stream objects...Ch. 12 - Under what circumstances is a file stream objects...Ch. 12 - Under what circumstances is a file stream objects...Ch. 12 - How do you read the contents of a text file that...Ch. 12 - What arguments do you pass to a file stream...Ch. 12 - What arguments do you pass to a file stream...Ch. 12 - Prob. 12RQECh. 12 - Prob. 13RQECh. 12 - How do you get the byte number of a files current...Ch. 12 - If a program has read to the end of a file, what...Ch. 12 - How do you determine the number of bytes that a...Ch. 12 - How do you rewind a sequential-access file?Ch. 12 - The _____ file stream data type is for output...Ch. 12 - If a file fails to open, the file stream object...Ch. 12 - The same formatting techniques used with...Ch. 12 - The _____ function reads a line of text from a...Ch. 12 - The ____________ member function reads a single...Ch. 12 - The ________member function writes a single...Ch. 12 - Prob. 24RQECh. 12 - __________ files contain data formatted as...Ch. 12 - Prob. 26RQECh. 12 - Prob. 27RQECh. 12 - The ___________ member function writes raw binary...Ch. 12 - The __________ member function reads raw binary...Ch. 12 - Prob. 30RQECh. 12 - In ___________ file access, the contents of the...Ch. 12 - In __________ file access, the contents of a file...Ch. 12 - The _____________ member function moves a files...Ch. 12 - The ___________ member function moves a files...Ch. 12 - The __________ member function returns a files...Ch. 12 - The ___________ member function returns a files...Ch. 12 - The __________ mode flag causes an offset to be...Ch. 12 - The __________ mode flag causes an offset to be...Ch. 12 - The ________ mode flag causes an offset to be...Ch. 12 - A negative offset causes the files read or write...Ch. 12 - Write a statement that defines a file stream...Ch. 12 - Write two statements that use a file stream object...Ch. 12 - Write two statements that use a file stream object...Ch. 12 - Write two statements that use a file stream object...Ch. 12 - Write a program segment that defines a file stream...Ch. 12 - Write code that opens the file data.txt for both...Ch. 12 - Write code that determines the number of bytes...Ch. 12 - The infoFile file stream object is used to...Ch. 12 - T F Different operating systems have different...Ch. 12 - T F fstream objects are only capable of performing...Ch. 12 - T F ofstream objects, by default, delete the...Ch. 12 - T F ifstream objects, by default, create a file if...Ch. 12 - T F Several file access flags may be joined by...Ch. 12 - T F A file may be opened in the definition of the...Ch. 12 - T F If a file is opened in the definition of the...Ch. 12 - T F A file stream objects fail member function may...Ch. 12 - T F The same output formatting techniques used...Ch. 12 - T F The operator expects data to be delimited by...Ch. 12 - T F The getline member function can be used to...Ch. 12 - T F It is not possible to have more than one file...Ch. 12 - T F Binary files contain unformatted data, not...Ch. 12 - T F Binary is the default mode in which files are...Ch. 12 - T F The tellp member function tells a file stream...Ch. 12 - T F It is possible to open a file for both input...Ch. 12 - fstream file(ios::in | ios::out);...Ch. 12 - ofstream file; file.open (info.dat, ios::tin); if...Ch. 12 - fstream file("info.dat"); if (!file) { cout ...Ch. 12 - fstream dataFile("info.dat", ios:in | ios:binary);...Ch. 12 - Prob. 69RQECh. 12 - fstream dataFi1e("info.dat", ios:in); char...Ch. 12 - Prob. 71RQECh. 12 - fstream inFile("info.dat", ios:in); int x;...Ch. 12 - File Head Program Write a program that asks the...Ch. 12 - File Display Program Write a program that asks the...Ch. 12 - Punch Line Write a program that reads and prints a...Ch. 12 - Tail Program Write a program that asks the user...Ch. 12 - Line Numbers (This assignment could be done as a...Ch. 12 - String Search Write a program that asks the user...Ch. 12 - Sentence Filter Write a program that asks the user...Ch. 12 - Array/File Functions Write a function named...Ch. 12 - File Encryption Filter File encryption is the...Ch. 12 - File Decryption Filter Write a program that...Ch. 12 - Prob. 11PCCh. 12 - Prob. 12PCCh. 12 - Inventory Program Write a program that uses a...Ch. 12 - Inventory Screen Report Write a program that reads...Ch. 12 - Average Number of Words If you have downloaded...Ch. 12 - Customer Accounts This program should be designed...
Knowledge Booster
Similar questions
- (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays so that a customer’s record can be accessed randomly by account number. Create the file by entering five customer records, with each record consisting of an integer account number (starting with account number 1000), a first name (maximum of 10 characters), a last name (maximum of 15 characters), and a double-precision number for the account balance. After the file is created, write a C++ program that requests a user-input account number and displays the corresponding name and account balance from the file.arrow_forward(Data processing) a. Store the following data in a file, or use the numbers.dat file provided on this book’s Web site. 5 96 87 78 93 21 4 92 82 85 87 6 72 69 85 75 81 73 b. Write a C++ program to calculate and display the average of each group of numbers in the file created in Exercise 2a. The data is arranged in the file so that each group of numbers is preceded by the number of data items in the group. Therefore, the first number in the file, 5, indicates that the next five numbers should be grouped together. The number 4 indicates that the following four numbers are a group, and the 6 indicates that the last six numbers are a group. (Hint: Use a nested loop. The outer loop should terminate when the end of file has been encountered.)arrow_forwardA pointer variable is O the same thing as an array subscript dereferences a pointer and allows access to the value of the variable the pointer points to an operator that returns the memory address of a variable a variable that holds an addressarrow_forward
- C++ Languagearrow_forwardFunction______________ changes the size of a block of previously allocated dynamic memoryarrow_forwardQuestion 1 Assume that arrX array is already defined and allocated in memory, its base address 0xabcd3000 and already stored in $a2 and its number of elements in $a3. Answer each of the next questions as required. arrX: .word 0x99,0x20,0x73,0x40,0x50,0x69, ... Please write question numbers and answer parts in this question in order. Q1) The fourth element of arrX is located at HEX address ___________ Q2) Write one MIPS instruction to copy into $t9 the value of the fourth element of arrX: ___________ Q3) Write one MIPS instruction to calculate $t0 = 32 * fourth element: __________ Q4) Write NO more than 3 MIPS instructions to decrement the fourth element of arrX: __________ Q5) Write no more than 6 instructions to calculate $v0= first element - last element in arrX.arrow_forward
- Fill-in-the-Blank Bubble sort places ________ number(s) in place on each pass through the data.arrow_forwardProgram in C language the creation of a vector of n=5 records, each record made up of the following fields: Product_name, Quantity, Price. Include the following functions: a) Vector reading b) Same Vector Screen Printing c) Save the vector to a file d) Read the vector from a file e) main()arrow_forwardhead data n data n data n Allocate a single block of struct node memory using the memory allocation function. in C language →nullarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr