Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN C++ PLease!!! I don't know how to fix my mistakes 6.13 LAB*: Program: Data visualization (Streams) (1) Prompt the user for a title for
IN C++ PLease!!! I don't know how to fix my mistakes
6.13 LAB*: Program: Data visualization (Streams) (1) Prompt the user for a title for data. Output the title. Ex: Enter a title for the data: Number of Novels Authored You entered: Number of Novels Authored (2) Prompt the user for the headers of two columns of a table. Output the column headers. Ex: Enter the column 1 header: Author name You entered: Author name Enter the column 2 header: Number of novels You entered: Number of novels (3) Open an output file named "novels.txt". Prompt the user for data points. Data points must be in this format: int string. The user will enter -1 done when they have finished entering data points. Output the data points. Write the data points to an output file. Assume the user enters valid input. Note: this part of the program has already been written and tested Review the code. Ex: Enter a data point (-1 done to stop input): 6 Jane Austen Data string: Jane Austen Data integer: 6 (4) Close the output file. (5) Open an input file named novels.txt. Now you are using the same file but this time you are reading data from the file and output the information in a formatted table. The title is right justified with a setw( value of 33. Column 1 has a setw() value of 20. Column 2 has a setw() value of 23. Ex: Number of Novels Authored Author name Number of novels 1 6 20 9 22 8 7 Jane Austen Charles Dickens Ernest Hemingway Jack Kerouac F. Scott Fitzgerald Mary Shelley Charlotte Bronte Mark Twain Agatha Christie Ian Flemming J.K. Rowling Stephen King Oscar Wilde 5 11 73 14 14 54 1 (6) Close the input file. (7) Open the input file named novels.txt again. Now you are reading data from the file and output the information as a formatted histogram (display a line of asterisks to match the number of novels written by each author). Each name is right justified with a setw() value of 20. (8) Close the input file. Ex: ***** (6) Close the input file. (7) Open the input file named novels.txt again. Now you are reading data from the file and output the information as a formatted histogram (display a line of asterisks to match the number of novels written by each author). Each name is right justified with a setw() value of 20. (8) Close the input file. Ex: ****** ****** Jane Austen Charles Dickens Ernest Hemingway Jack Kerouac F. Scott Fitzgerald Mary Shelley Charlotte Bronte Mark Twain Agatha Christie Ian Flemming J.K. Rowling Stephen King Oscar Wilde * 293630.1711880 main.cpp Load default template... 1 /* 2 Writing to, reading from data files. 3 Project: Novels 4 5 Name: 6 */ 7 #includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started