Question: The driver program is written in the evaluateReviews _ starter.cpp file. Don't forget to remove _ starter from the filename before you try to compile

The driver program is written in the evaluateReviews_starter.cpp file. Don't forget to remove _starter from the filename before you try to compile with this file!
```
// Add any #includes for C++ Libraries here.
// We have already included iostream as an example.
#include
// The #include adds all the function declarations (a.k.a. prototypes) from the
// reviews.h file, which means the compiler knows about them when it is compiling
// the main function below (e.g. it can verify the parameter types and return types
// of the function declarations match the way those functions are used in main()).
// However, the #include does not add the actual code for the functions, which is
// in reviews.cpp. This means you need to compile with a g++ command including both
//.cpp source files. For this project, we will being using some features from C++11,
// which requires an additional flag. Compile with this command:
// g++--std=c++11 evaluateReviews.cpp reviews.cpp -o evaluateReviews
#include "reviews.h"
using namespace std;
const double SCORE_LIMIT_TRUTHFUL =3;
const double SCORE_LIMIT_DECEPTIVE =-3;
int main(){
// TODO: implement the main program
}
```
Algorithm
This is the general algorithm for the driver program (the main function in evaluateReviews.cpp):
1. Open a file input stream for the keywordWeights.txt file.
i. If the file cannot be opened, print "Error: keywordWeights.txt could not be opened." to cout
ii. Use return 1; to exit the main function (recall that a nonzero return value from main reports an error).
2. If the keyword weights file was opened, read the keywords and their weights into parallel vectors. (Which Reviews library function would be helpful here?)3. For each hotel review,
i. Create the filename (e.g. review00.txt )(Which Reviews library function would be helpful here?)
ii. Open a filestream to the file
iii. Read each word of the review into a vector of string variables (Which Reviews library function would be helpful here?)
iv. Calculate the review's score (Which Reviews library function would be helpful here?)
v. Determine the review's category:
- truthful: score >3.0
- deceptive: score -3.0
- uncategorized: otherwise
vi. Track the review with the highest score and the review with the lowest score
4. Write out a summary of the truthfulness and deceptiveness of the reviews to a file named report.txt
5. Print "Program complete. Check report.txt file for summary." to cout to indicate that the program has finished. Do not print the contents of report.txt .
- Note: There should be two spaces after Program complete. not just one. Your browser may "collapse" these two spaces into one space when you view these specs.
ou know that you have processed all the reviews once you try to open a file input stream for the next review file nd it does not open successfully (because the file doesn't exist!). You don't need to print an error message in this ase - simply have your program stop trying to read more reviews.
(i) You are guaranteed that there will always be at least one review and that there will be no gaps in the numbering of the hotel reviews. There will be no more than 100 hotel reviews.
Make sure your summary of the reviews is being written to the report.txt file, not cout.
You may write additional helper functions in evaluateReviews.cpp!(See the Additional Helper Functions section for some suggestions.) However, do not add additional functions to reviews.cpp that you intend to use in evaluateReviews.cpp, since this would require modifying the review.h file to contain their prototypes as well, which is prohibited for this project. Instead, put your own additional helper functions into the evaluateReviews.cpp file.
Jetails of the Summary Report
here is one output file for this program: report.txt . This file contains a summary report of your hotel review nalysis. The summary report should contain:
- A header line, reading exactly review score category
- A line of information for each report including the following (separated by spaces)
- Review number (\(0,1,2\), etc.)
- The overall score of the review
- The categorization (truthful, deceptive, or uncategorized)
-[an extra blank line]
- The total number of reviews analyzed
The total number of truthful reviews
- The total number of deceptive reviews
The total number of uncategorized reviews
[an extra blank line]
- The number of the review with the highest score (You may assume there are no "ties".) There is one output file for this program: report.txt . This file contains a summary report of your hotel review analysis. The summary report should contain:
- A header line, reading exactly review score category
- A line of information for each report including the following (separated by spaces)
- Review number (\(0,1,2\), etc.)
- The overall score of the review
- The categorization (truthful, deceptive, or uncategorized)
[an extra blank line]
- The total number of reviews analyzed
- The total number of truthful reviews
- The total number of deceptive reviews
- The total number of uncategorized reviews
[an extra blank line]
- The number of the re
The driver program is written in the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!