Introduction and Workshop Tasks & The Book Information: A text file contains information about a set of books. The token for separating information for each book is the semicolon; . There is a separate line for each book entry. Each book in this text file has a name, an author, a year of publication and a price. Your mission is to extract this information from the file and store it somewhere in your program. Once you have completed the extraction, you are to print out information for each of the books. Data Format Information for each book is stored as follows: NAME; AUTHOR; YEAR; PRICE; Note that the book's name and author might consist of many strings. The text file containing all book information can be found at Book.txt. The data stored there is: In Search of Lost Time; Marcel Proust; 1913;17.99; Ulysses; James Joyce; 1904;21.95; Don Quixote; Miguel de Cervantes; 1605; 21.49; One Hundred Years of Solitude; Gabriel Garcia Marquez; 1982; 28.09; The Great Gatsby; F. Scott Fitzgerald; 1925; 10.99; Moby Dick; Herman Melville; 1851;6.23 Brave New World; Aldous Huxley; 1932;11.89; The Catcher in the Rye;3.D. Salinger; 1951;8.99; Crime and Punishment;Fyodor Dostoevsky; 1866;15.90; The Brothers Karamazov; Fyodor Dostoevsky; 1880; 16.45; A Tale of Two Cities; Charles Dickens; 1859;10.45; The Little Prince; Antoine de Saint-Exupéry; 1943;7.50; The Odyssey; Homer; Approx. 700 BC;8.25; Anna Karenina; Leo Tolstoy; 1877;14.30; The Count of Monte Cristo; Alexandre Dumas; 1844; 17.20; Lord of the Rings; J.R.R. Tolkien; 1954; 25.90; Gone idith the ut Q

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Topic Video
Question
I would greatly appreciate sir
Introduction and Workshop Tasks &
The Book Information:
A text file contains information about a set of books. The token for separating information for each book is the
semicolon ; . There is a separate line for each book entry. Each book in this text file has a name, an author, a
year of publication and a price. Your mission is to extract this information from the file and store it somewhere
in your program. Once you have completed the extraction, you are to print out information for each of the
books.
Data Format
Information for each book is stored as follows:
NAME; AUTHOR; YEAR; PRICE;
Note that the book's name and author might consist of many strings. The text file containing all book
information can be found at Book.txt.
The data stored there is:
In Search of Lost Time; Marcel Proust; 1913; 17.99;
Ulysses; James Joyce; 1904;21.95;
Don Quixote; Miguel de Cervantes; 1605;21.49;
One Hundred Years of Solitude; Gabriel Garcia Marquez; 1982; 28.09;
The Great Gatsby; F. Scott Fitzgerald; 1925; 10.99;
Moby Dick; Herman Melville; 1851;6.23
Brave New World; Aldous Huxley; 1932;11.89;
The Catcher in the Rye;3.D. Salinger; 1951;8.99;
Crime and Punishment; Fyodor Dostoevsky; 1866; 15.90;
The Brothers Karamazov; Fyodor Dostoevsky; 1880; 16.45;
A Tale of Two Cities; Charles Dickens; 1859;10.45;
The Little Prince; Antoine de Saint-Exupéry; 1943;7.50;
The Odyssey; Homer; Approx. 700 BC;8.25;
Anna Karenina; Leo Tolstoy; 1877; 14.30;
The Count
Monte Cristo; Alexandre Dumas; 1844; 17.20;
Lord of the Rings; J.R.R. Tolkien; 1954; 25.90;
Gone with the Wind; Margaret Mitchell; 1936;14.85;
Setup: Command Line Arguments:
Book.txt must be passed through to your program by command line. Let's assume your executable is called
BookMain.exe, then BookMain.exe will be invoked from the command line as follows:
BookMain.exe Book.txt
Command line arguments are passed through to your program through the main function as follows:
int main(int arge, chart argv[1)
arge is the argument count (which in this case is 2), and argv[] is an array of strings representing the
arguments (in this case argv[0]-"BookHain.exe" and argv[1]-"Book.txt").
• In Visual Studio, you can set the command line arguments through the project's properties as follows:
o Click on the project name.
o Right click on Properties.
o Click on Configuration Properties, then click on Debugging.
o Look for Command Arguments and enter in the command argument (which in this case is Book.txt)
1.9
Transcribed Image Text:Introduction and Workshop Tasks & The Book Information: A text file contains information about a set of books. The token for separating information for each book is the semicolon ; . There is a separate line for each book entry. Each book in this text file has a name, an author, a year of publication and a price. Your mission is to extract this information from the file and store it somewhere in your program. Once you have completed the extraction, you are to print out information for each of the books. Data Format Information for each book is stored as follows: NAME; AUTHOR; YEAR; PRICE; Note that the book's name and author might consist of many strings. The text file containing all book information can be found at Book.txt. The data stored there is: In Search of Lost Time; Marcel Proust; 1913; 17.99; Ulysses; James Joyce; 1904;21.95; Don Quixote; Miguel de Cervantes; 1605;21.49; One Hundred Years of Solitude; Gabriel Garcia Marquez; 1982; 28.09; The Great Gatsby; F. Scott Fitzgerald; 1925; 10.99; Moby Dick; Herman Melville; 1851;6.23 Brave New World; Aldous Huxley; 1932;11.89; The Catcher in the Rye;3.D. Salinger; 1951;8.99; Crime and Punishment; Fyodor Dostoevsky; 1866; 15.90; The Brothers Karamazov; Fyodor Dostoevsky; 1880; 16.45; A Tale of Two Cities; Charles Dickens; 1859;10.45; The Little Prince; Antoine de Saint-Exupéry; 1943;7.50; The Odyssey; Homer; Approx. 700 BC;8.25; Anna Karenina; Leo Tolstoy; 1877; 14.30; The Count Monte Cristo; Alexandre Dumas; 1844; 17.20; Lord of the Rings; J.R.R. Tolkien; 1954; 25.90; Gone with the Wind; Margaret Mitchell; 1936;14.85; Setup: Command Line Arguments: Book.txt must be passed through to your program by command line. Let's assume your executable is called BookMain.exe, then BookMain.exe will be invoked from the command line as follows: BookMain.exe Book.txt Command line arguments are passed through to your program through the main function as follows: int main(int arge, chart argv[1) arge is the argument count (which in this case is 2), and argv[] is an array of strings representing the arguments (in this case argv[0]-"BookHain.exe" and argv[1]-"Book.txt"). • In Visual Studio, you can set the command line arguments through the project's properties as follows: o Click on the project name. o Right click on Properties. o Click on Configuration Properties, then click on Debugging. o Look for Command Arguments and enter in the command argument (which in this case is Book.txt) 1.9
Preview Code Blame 191 lines (126 loc) 13.1 KB
Sample Output
A sample run for the first 5 books is as follows:
In Search of Lost Time
Ulysses
Don Quixote
One Hundred Years of Solitude
The Great Gatsby
BOOK INFORMATION
Your organizatio Raw
Marcel Proust 1913 $17.99
1904 $21.95
James Joyce
Miguel de Cervantes 1605 $21.49
Gabriel Garcia Marquez 1982 $28.09
F. Scott Fitzgerald 1925 $10.99
‚↓,
pilot
Transcribed Image Text:Preview Code Blame 191 lines (126 loc) 13.1 KB Sample Output A sample run for the first 5 books is as follows: In Search of Lost Time Ulysses Don Quixote One Hundred Years of Solitude The Great Gatsby BOOK INFORMATION Your organizatio Raw Marcel Proust 1913 $17.99 1904 $21.95 James Joyce Miguel de Cervantes 1605 $21.49 Gabriel Garcia Marquez 1982 $28.09 F. Scott Fitzgerald 1925 $10.99 ‚↓, pilot
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Instruction Format
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage