Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with my Computer Science 2 project. I tried to post all pf the codes

ID: 3605579 • Letter: I

Question

I need help with my Computer Science 2 project. I tried to post all pf the codes for the project but it wouldn't let me.

Develop a high-quality, menu-driven object-oriented C++ program that creates a small database, using a binary search tree structure to store and process the data. The database will contain the top 100 highest grossing films of 2015.

The C++ object-oriented program must use the BinarySearchTree class from the textbook (along with the BinaryNode, BinaryNodeTree, BinaryTreeInterface, NotFoundException,and PrecondViolatedExcep classes it requires) to fulfill the requirements of this project. When designing and implementing the program, apply good software engineering principles. Create a makefile for the program that allows compilation and execution of the program from within jGRASP using the Windows operating system. Start the analysis and design process by drawing a complete UML class diagram for the program that includes all the classes that are contained in the program, including the classes provided by the textbook and the classes that you create. The UML class diagram will assist you in understanding the components of the project.

Your program must include:

a Film class that stores all the data for a Film and provides appropriate methods to support good software engineering principles,

a FilmDatabase class that stores the binary search tree and provides appropriate methods to support good software engineering principles,

a Menu class that contains, as a minimum, a method for each menu used in the program that displays the menu and responds to all menu choices made by the user, calling appropriate methods in the FilmDatabase class as necessary, and

a file named Project1.cpp that contains the main() method.

You may also include other classes, as needed. Note that the binary search tree must store Film objects, and the >, <, and == operators must be defined for that class because the BinarySearchTree class uses those overloaded operators.

The downloaded files include the Student class (Student.h and Student.cpp), the StudentDatabase class (StudentDatabase.h and StudentDatabase.cpp), BSTTest.cpp, and makefile for you to use as an example to help you begin your program. The program compiles, links, and executes if you Make it using jGRASP/Windows.

Data Details:

The database contains data pertaining to the 100 highest grossing films of 2015. A comma delimited file named Films2015.csv contains the initial data. Each record is stored on one line of the file in the following format:

    Data                  Data type

Rank               int

Film Title (key)    string

Studio             string

Total Gross         double

Total Theaters      int

Opening Gross       double

Opening Theaters    int

Opening Date        string

Each of the data fields is separated in the file using the comma (,) character as a delimiter. There is no comma (,) character after the last field on the line. The data is considered clean; There are no errors in the input file.

When storing the data in the binary search tree, use the data types shown above. The Film Title will serve as the key field (its value is unique).

Menu Details:

Your program must begin by inputting the text data from the Films2015.csv text file and building a binary search tree for the Films, in order by the key (the film title). Then the program must display the following Main Menu:

MAIN MENU

D - Describe the Program

R – Reports

S - Search the Database

X - Exit the Program

Enter Selection ->

All menu choices are selected by typing the number of the choice.

D - Describe the Program

If the user chooses Describe the Program, the program provides a detailed description for the user, explaining what the program is doing and how it works. Note that this method does NOT substitute for javadoc-style comments. The audience for this method consists of non-technical users that have no information at all about the assignment. After providing the description, display the MAIN MENU again. Do NOT use recursion to do this; use a loop.

R - Reports

If the user chooses Reports from the MAIN MENU, the program displays the following menu:

              REPORTS MENU
T - Order by Film Title report
R - Order by Rank report
X - Return to main menu

Enter Selection ->

If the user chooses Order by Film Title report from the REPORTS MENU, the program should do the following:

Display a report in order by Film Title that contains all the data for each record stored in the binary search tree.

Identify the report and label all the data displayed appropriately.

If the user chooses Order by Rank report from the REPORTS MENU, the program should do the following:

Display a report sorted in increasing order by earnings rank that contains all the data for each record stored in the binary search tree. Note that this does not involve a simple tree traversal or single method call. You will need to write code that specifically performs this function. You may assume that the rank is never less than 1 and never greater than 100. Do NOT copy the data into another binary search tree, into an array, into a linked list, vector or into any other type of data structure. Retrieve the data directly from the binary search tree which is stored in order by the Film Title.

Identify the report and label all the data displayed appropriately.

If the user chooses Return to main menu from the REPORTS MENU, then display the MAIN MENU again. Do NOT use recursion to do this; use a loop.

S - Search the Database

If the user chooses Search the database, the program should display another menu, as follows:

Search Menu

T - Search by Title

K - Search by Keyword(s)

S - Search by Studio

M - Search by month of release

X - Return to main menu

Enter Selection ->

If the user chooses Search by Title, the program should do the following:

Request a film title from the user.

Search the database for the title given. This will be an exact match of the film title and at most, only 1 record will match. A case insensitive search should be performed.

If the film title is found, display the record stored in the binary search tree. Otherwise report that the requested film title was not found.

Identify the output and label all the data displayed appropriately.

If the user chooses Search by Keyword(s), the program should do the following:

Request title keywords from the user.

Search the database for all titles that contain the keyword(s). The keywords given represent all or a portion of the title. When multiple keywords are given, only titles that contain the keywords in the order given will be selected. For example, if the user enters ‘Star Wars’, “Star Wars: The Force Awakens” will be selected as will “The Making of Star Wars”. However, “One Star, Many Wars”, “Once Upon a Star”, “Wars” and “Wars with Stars” will not be selected.

Multiple search keywords may be entered by separating the keywords with a comma. All titles containing one or more of the keywords will be selected. For example, if the user enters 'Cinderella,SpongeBob,Dinosaur', "Cinderella", "The Good Dinosaur", "In Search of Dinosaurs", "The SpongeBob Movie: Sponge Out of Water" as well as "Cinderella Loves Dinosaurs and SpongeBob!" will be selected.

Display all records stored in the binary search tree where the title contains the keyword(s) given by the user. If there are no records containing the keyword(s), report that the requested keyword(s) were not found.

Identify the output and label all the data displayed appropriately.

If the user chooses Search by Studio, the program should do the following:

Request the name of a Studio from the user.

Search the database for an exact match of the studio name.

Display all records stored in the binary search tree where the studio name matches the name given by the user. If there are no records with the studio name given, report that the requested studio was not found.

Identify the output and label all the data displayed appropriately.

If the user chooses Search by month of release, the program should do the following:

Request a month value between 1 and 12 from the user.

Search the database for all records where the release date contains the month requested. Note: the date is stored as a string.

Display all records stored in the binary search tree that match the month given by the user. If there are no records with the requested release month, report that the requested month was not found.

Identify the output and label all the data displayed appropriately.

If the user chooses Return to main menu, then display the MAIN MENU again. Do NOT use recursion to do this; use a loop.

X – Exit the Program

If the user chooses Exit the Program from the MAIN MENU, the program ends.

Since the program is controlled and manipulated by a human user, be sure to perform adequate error checking on every aspect of the program.

Be sure to follow the Project Guidelines & Evaluation Criteria, since the project will be evaluated using this criteria. In addition, be sure to use javadoc-style comments appropriately. When creating javadoc-style comments, keep in mind that the comment will eventually become part of an html file that will be used by other programmers on your programming team, and by maintenance programmers. Remember also that maintenance programmers have not seen the assignment (the specification), so the information you are providing here must provide all of the detailed information another programmer will need to completely understand the program and to maintain the code.

BinaryTreeInterface.h

#ifndef BINARY_TREE_INTERFACE_
#define BINARY_TREE_INTERFACE_

#include "NotFoundException.h"

template<class ItemType>
class BinaryTreeInterface
{
public:
/** Tests whether this binary tree is empty.
@return True if the binary tree is empty, or false if not. */
virtual bool isEmpty() const = 0;

/** Gets the height of this binary tree.
@return The height of the binary tree. */
virtual int getHeight() const = 0;

/** Gets the number of nodes in this binary tree.
@return The number of nodes in the binary tree. */
virtual int getNumberOfNodes() const = 0;

/** Gets the data that is in the root of this binary tree.
@pre The binary tree is not empty.
@post The root’s data has been returned, and the binary tree is unchanged.
@return The data in the root of the binary tree. */
virtual ItemType getRootData() const = 0;

/** Replaces the data item in the root of this binary tree
with the given data, if the tree is not empty. However, if
the tree is empty, inserts a new root node containing the
given data into the tree.
@pre None.
@post The data in the root of the binary tree is as given.
@param newData The data for the root. */
virtual void setRootData(const ItemType& newData) = 0;

/** Adds a new node containing the given data to this binary tree.
@param newData The data for the new node.
@post The binary tree contains a new node.
@return True if the addition is successful, or false not. */
virtual bool add(const ItemType& newData) = 0;

/** Removes the node containing the given data item from this binary tree.
@param data The data value to remove from the binary tree.
@return True if the removal is successful, or false not. */
virtual bool remove(const ItemType& data) = 0;

/** Removes all nodes from this binary tree. */
virtual void clear() = 0;

/** Gets a specific entry in this binary tree.
@post The desired entry has been returned, and the binary tree
is unchanged. If no such entry was found, an exception is thrown.
@param anEntry The entry to locate.
@return The entry in the binary tree that matches the given entry.
@throw NotFoundException if the given entry is not in the tree. */
virtual ItemType getEntry(const ItemType& anEntry) const
throw(NotFoundException) = 0;

/** Tests whether a given entry occurs in this binary tree.
@post The binary search tree is unchanged.
@param anEntry The entry to find.
@return True if the entry occurs in the tree, or false if not. */
virtual bool contains(const ItemType& anEntry) const = 0;

/** Traverses this binary tree in preorder (inorder, postorder) and
calls the function visit once for each node.
@param visit A client-defined function that performs an operation on
or with the data in each visited node. */
virtual void preorderTraverse(void visit(ItemType&)) const = 0;
virtual void inorderTraverse(void visit(ItemType&)) const = 0;
virtual void postorderTraverse(void visit(ItemType&)) const = 0;

/** Destroys object and frees memory allocated by object. */
virtual ~BinaryTreeInterface() { }

}; // end BinaryTreeInterface
#endif

BSTTest.cpp

#include "StudentDatabase.h"
#include <cstdlib>
#include <iostream>
using namespace std;

void explanation(void);


int main (void)
{
explanation();
  
StudentDatabase studentDB; // database to store Student objects
studentDB.createDatabase();
studentDB.displayData();
studentDB.saveDatabase();

return EXIT_SUCCESS;
}


/**
* Provides an explanation of the program for the user
*/
void explanation(void)
{
cout << "This program demonstrates the use of a binary search tree" << endl;
cout << "to store items of the Student class type to help CTP 250" << endl;
cout << "students understand how to use the binary search tree classes" << endl;
cout << "provided by the textbook. The program creates eight arbitrary" << endl;
cout << "pre-defined Student objects, which consist of name, id," << endl;
cout << "and phone, and adds them to a binary search tree. It then" << endl;
cout << "inputs data for a new Student object from the user, giving" << endl;
cout << "the user specific instructions about data entry. The program" << endl;
cout << "adds the entered Student object to the binary search tree." << endl << endl;
cout << "The program searches for a specific student in the tree, and" << endl;
cout << "deletes that student, if found. The program then displays the" << endl;
cout << "data in the binary search tree using an inorder traversal," << endl;
cout << "which results in an alphabetical listing of Student objects" << endl;
cout << "in the tree. Next, the program displays the contents of the" << endl;
cout << "tree using a preorder and a postorder traversal, so the order" << endl;
cout << "of the Student objects appears random. Before exiting, the"<< endl;
cout << "program saves the data for each Student object in the tree" << endl;
cout << "to a text file using a preorder traversal." << endl << endl;
}

Films2015

1 Star Wars: The Force Awakens BV 9.16E+08 4134 2.48E+08 4134 ######## 2 Jurassic World Uni. 6.52E+08 4291 2.09E+08 4274 ######## 3 Avengers: Age of Ultron BV 4.59E+08 4276 1.91E+08 4276 5/1/2015 4 Inside Out BV 3.56E+08 4158 90440272 3946 ######## 5 Furious 7 Uni. 3.53E+08 4022 1.47E+08 4004 4/3/2015 6 Minions Uni. 3.36E+08 4311 1.16E+08 4301 ######## 7 The Hunger Games: Mockingjay - Part 2 LGF 2.81E+08 4175 1.03E+08 4175 ######## 8 The Martian Fox 2.28E+08 3854 54308575 3831 ######## 9 Cinderella (2015) BV 2.01E+08 3848 67877361 3845 ######## 10 Spectre Sony 2E+08 3929 70403148 3929 ######## 11 Mission: Impossible - Rogue Nation Par. 1.95E+08 3988 55520089 3956 ######## 12 Pitch Perfect 2 Uni. 1.84E+08 3660 69216890 3473 ######## 13 Ant-Man BV 1.8E+08 3868 57225526 3856 ######## 14 Home (2015) Fox 1.77E+08 3801 52107731 3708 ######## 15 Hotel Transylvania 2 Sony 1.7E+08 3768 48464322 3754 ######## 16 Fifty Shades of Grey Uni. 1.66E+08 3655 85171450 3646 ######## 17 The SpongeBob Movie: Sponge Out of Water Par. 1.63E+08 3680 55365012 3641 2/6/2015 18 Straight Outta Compton Uni. 1.61E+08 3142 60200180 2757 ######## 19 The Revenant Fox 1.6E+08 3711 474560 4 ######## 20 San Andreas WB 1.55E+08 3812 54588173 3777 ######## 21 Mad Max: Fury Road WB 1.54E+08 3722 45428128 3702 ######## 22 Daddy's Home Par. 1.47E+08 3483 38740203 3271 ######## 23 The Divergent Series: Insurgent LG/S 1.3E+08 3875 52263680 3875 ######## 24 The Peanuts Movie Fox 1.3E+08 3902 44213073 3897 ######## 25 Kingsman: The Secret Service Fox 1.28E+08 3282 36206331 3204 ######## 26 The Good Dinosaur BV 1.21E+08 3749 39155217 3749 ######## 27 Spy Fox 1.11E+08 3715 29085719 3711 6/5/2015 28 Trainwreck Uni. 1.1E+08 3171 30097040 3158 ######## 29 Creed WB 1.09E+08 3502 29632823 3404 ######## 30 Tomorrowland BV 93436322 3972 33028165 3972 ######## 31 Get Hard WB 90411453 3212 33803253 3175 ######## 32 Terminator: Genisys Par. 89760956 3783 27018486 3758 7/1/2015 33 Taken 3 Fox 89256424 3594 39201657 3594 1/9/2015 34 Sisters Uni. 86623660 2978 13922855 2962 ######## 35 Alvin and the Chipmunks: The Road Chip Fox 84170141 3705 14287159 3653 ######## 36 Maze Runner: The Scorch Trials Fox 81697192 3792 30316510 3791 ######## 37 Ted 2 Uni. 81476385 3448 33507870 3442 ######## 38 Goosebumps Sony 80021740 3618 23618556 3501 ######## 39 Pixels Sony 78747585 3723 24011616 3723 ######## 40 Paddington W/Dim. 76271832 3355 18966676 3303 ######## 41 The Intern WB 75764672 3320 17728313 3305 ######## 42 Bridge of Spies BV 72086318 2873 15371203 2811 ######## 43 Paul Blart: Mall Cop 2 Sony 71038190 3633 23762435 3633 ######## 44 War Room TriS 67790117 1945 11351389 1135 ######## 45 Magic Mike XXL WB 66013057 3376 12857184 3355 7/1/2015 46 The Big Short Par. 65881837 2529 705527 8 ######## 47 The Visit Uni. 65206105 3148 25427560 3069 ######## 48 The Wedding Ringer SGem 64460211 3003 20649306 3003 ######## 49 Black Mass WB 62575678 3188 22635037 3188 ######## 50 Vacation WB (NL) 58884188 3430 14681108 3411 ######## 51 The Perfect Guy SGem 57027435 2230 25888154 2221 ######## 52 Joy Fox 56119692 2924 17015168 2896 ######## 53 Fantastic Four Fox 56117548 4004 25685737 3995 8/7/2015 54 Focus (2015) WB 53862963 3323 18685137 3323 ######## 55 The Hateful Eight Wein. 53350994 2938 4610676 100 ######## 56 Southpaw Wein. 52421953 2772 16701294 2772 ######## 57 Insidious Chapter 3 Focus 52218558 3014 22692741 3002 6/5/2015 58 Poltergeist (2015) Fox 47425125 3242 22620386 3240 ######## 59 Jupiter Ascending WB 47387723 3181 18372372 3181 2/6/2015 60 Sicario LGF 46889293 2620 401288 6 ######## 61 The Man From U.N.C.L.E. WB 45445109 3673 13421036 3638 ######## 62 McFarland USA BV 44482410 2792 11020798 2755 ######## 63 The Gift (2015) STX 43787265 2503 11854273 2503 8/7/2015 64 Everest (2015) Uni. 43482270 3009 7222035 545 ######## 65 The Night Before Sony 43035725 2960 9880536 2960 ######## 66 Krampus Uni. 42725475 2919 16293325 2902 ######## 67 Max (2015) WB 42656255 2870 12155254 2855 ######## 68 The Age of Adaline LGF 42629776 3070 13203458 2991 ######## 69 The Longest Ride Fox 37446117 3371 13019686 3366 ######## 70 Spotlight ORF 37337021 1089 295009 5 ######## 71 The Boy Next Door Uni. 35423380 2615 14910105 2602 ######## 72 Pan WB 35088320 3515 15315435 3515 ######## 73 Hot Pursuit WB 34580201 3037 13942258 3003 5/8/2015 74 Concussion (2015) Sony 34255169 2841 10513749 2841 ######## 75 Brooklyn FoxS 34221253 962 187281 5 ######## 76 The DUFF LGF 34030343 2622 10809149 2575 ######## 77 Woman in Gold Wein. 33307793 2011 2091551 258 4/1/2015 78 The Second Best Exotic Marigold Hotel FoxS 33078266 2022 8540370 1573 3/6/2015 79 Unfriended Uni. 32482090 2775 15845115 2739 ######## 80 Entourage WB 32363404 3108 10283250 3108 6/3/2015 81 Paper Towns Fox 32000304 3031 12650140 3031 ######## 82 Chappie Sony 31569268 3201 13346782 3201 3/6/2015 83 Crimson Peak Uni. 31090320 2991 13143310 2984 ######## 84 A Walk in the Woods BG 29504281 2158 8246267 1960 9/2/2015 85 Point Break (2015) WB 28661671 2910 9800252 2910 ######## 86 Sinister 2 Focus 27740955 2799 10542116 2766 ######## 87 The Last Witch Hunter LG/S 27367660 3082 10812861 3082 ######## 88 No Escape Wein. 27288872 3415 8111264 3355 ######## 89 Ricki and the Flash TriS 26822144 2064 6610961 1603 8/7/2015 90 The Woman in Black 2: Angel of Death Rela. 26501323 2602 15027415 2602 1/2/2015 91 Run All Night WB 26461644 3171 11012305 3171 ######## 92 Love the Coopers LGF 26302731 2603 8317545 2603 ######## 93 The Lazarus Effect Rela. 25801047 2666 10203437 2666 ######## 94 Ex Machina A24 25442958 2004 237264 4 ######## 95 In the Heart of the Sea WB 25020758 3103 11053366 3103 ######## 96 The Gallows WB 22764410 2720 9808463 2720 ######## 97 Hitman: Agent 47 Fox 22467450 3273 8326530 3261 ######## 98 Project Almanac Par. 22348241 2900 8310252 2893 ######## 99 Black or White Rela. 21571189 1823 6213362 1823 ######## 100 Aloha Sony 21067116 2815 9670235 2815 ########

Explanation / Answer

Movie.cpp

//Include required library files
#include "stdafx.h"
#include<iostream>
#include<stdio.h>
#include<string>
#include<fstream>

//use namespace
using namespace std;

//Define structure named Movie
struct MovieData
{
   //Declare hetrogeneous elements
   int rank;
   string FilmTitle;
   string Studio;
   double   TotalGross;
   int   TotalTheaters;
   double OpeningGross;
   int   OpeningTheaters;
   string OpeningDate;
};

//Define class Movie
class Movie
{
public:
   //Declare the essential methods
   char describe();
   void sortRankReport();
   void sortTitleReport();
};

//Class Menu displays all the methods used
//to display menu
class Menu
{
public:
   //Declare the essential methods
   char getmenu();
   char getReport();
   char getSearch();
   void setReport(char ch);
   void setSearch(char ch);
};


//Class FilmDatabase contains all the methods
//to search in the class
class FilmDatabase
{
public:
   //Declare the essential methods
   void searchTitle();
   void searchKeyword();
   void searchStudio();
   void searchMonthRelease();
   struct MovieData fileOpen();
};


//Method to open the file and stores the values in the variables
struct MovieData FilmDatabase::fileOpen()
{
   struct MovieData m[100];
   ifstream file;
   //open the file and prompt if an error occurs
   file.open("Films2015.txt");

   //Display a relevant message if file
   //did not open
   if (file.fail())
   {
       cout << " Can't open Films2015.txt ";
   }

   //Read from the file
   for (int i = 0; i < 100; i++)
   {
       //If file is opened then read from it
  
       if (file.is_open())
       {
           file >> m[i].rank;
           file >> m[i].FilmTitle;
           file >> m[i].Studio;
           file >> m[i].TotalGross;
           file >> m[i].TotalTheaters;
           file >> m[i].OpeningGross;
           file >> m[i].OpeningTheaters;
           file >> m[i].OpeningDate;
           return m[i];
       }
   }
   //close the file
   file.close();  
}


//Method to give the discription and working of the project
char Movie::describe()
{
   char choice;
   cout << "Hii in the following project, Movie names are "
       "given released in 2015. The movie names are "
       "sorted according to the Rank Report as well as "
       "title as user demand. In this project search "
       "technique is also applied. User can search "
       "by giving title name,studio name or by entering "
       "any keyword or by month. ";
   cout << " Press X to go to Main Menu : ";
   cin >> choice;
   return choice;
}

//Method to display the choice of main menu
char Menu:: getmenu()
{
   char choice;
   cout << " Main Menu: ";
   cout << "D - Describe the Program : ";
   cout << "R - Reports : ";
   cout << "S - Search the Database : ";
   cout << "X - Exit the Program : ";
   cout << "Enter Selection -> ";
   cin >> choice;
   return choice;
}


//Method to represent the options after clicking report
char Menu::getReport()
{
   char choice;
   cout << " REPORTS MENU: ";
   cout << "T - Order by Film Title report ";
   cout << "R - Order by Rank report ";
   cout << "X - Return to main menu ";
   cout << "Enter Selection -> ";
   cin >> choice;
   return choice;
}

//Method shows switch case to show report choices
void Menu::setReport(char ch)
{
   Movie film;
   switch (ch)
   {
   case 'T':
       film.sortTitleReport();
       break;
   case 'R':
       film.sortRankReport();
       break;
   case 'X':
       break;
   default:
       cout << " Enter choice correctly : ";
   }
}

//Method sorts the data according to ranks
void Movie::sortRankReport()
{
   struct MovieData m[100];
   FilmDatabase film;
   for (int i = 0; i < 100; i++)
   {      
       m[i] = film.fileOpen();
   }
  
   //Declare required variables
   int temp, i, j;

   //For loops used for sorting
   for (i = 0; i <= 10; i++)
   {
       for (j = 0; j <= 10 - i; j++)
       {
           if (m[j].rank > m[j + 1].rank)
           {
               temp = m[j].rank;
               m[j].rank = m[j + 1].rank;
               m[j + 1].rank = temp;
           }
       }
   }
   cout << " Ranks after sorting: ";
   cout << "Rank MovieTitle Studio Total Gross"
       " TotalTheaters Opening Gross Opening Theaters"
       " Opening Date" << " ";
  
   //Display after sorting
   for (int j = 0; j < 10; j++)
   {
       cout << m[j].rank << " ";
       cout << m[j].FilmTitle << " ";
       cout << m[j].Studio << " ";
       cout << m[j].TotalGross << " ";
       cout << m[j].TotalTheaters << " ";
       cout << m[j].OpeningGross << " " << " ";
       cout << m[j].OpeningTheaters << " ";
       cout << m[j].OpeningDate << " ";
   }
}

//Method to display menu for search
char Menu::getSearch()
{
   char choice;
   cout << " Search MENU ";
   cout << "T - Search by Title ";
   cout << "K - Search by Keyword(s) ";
   cout << "S - Search by Studio ";
   cout << "M - Search by month of release ";
   cout << "X - Return to main menu ";
   cout << "Enter Selection -> ";
   cin >> choice;
   return choice;
}

//Method for switch case to apply search operation
void Menu::setSearch(char ch)
{
   FilmDatabase data;
   switch (ch)
   {
   case 'T':
       data.searchTitle();
       break;
   case 'K':
       data.searchKeyword();
       break;
   case 'S':
       data.searchStudio();
       break;
   case 'M':
       data.searchMonthRelease();
       break;
   case 'X':
       break;
   default:
       cout << "Enter choice correctly : ";
   }
}

//Method to search according to title
void FilmDatabase::searchTitle()
{
   struct MovieData m[100];
   FilmDatabase film;
   for (int i = 0; i < 100; i++)
   {
       m[i] = film.fileOpen();
   }
   string title;
   cout << " Enter the movie Title to be searched: ";
   cin >> title;
   for (int i = 0; i < 100; i++)
   {
       if (title == m[i].FilmTitle)
       {
           cout << " Hi "<<title<<" present in the top "
               "100 movie list. It is at the "<<i<<" rank. ";
           break;
       }
   }
}

//Method to search any keyword
void FilmDatabase::searchKeyword()
{
   struct MovieData m[100];
   FilmDatabase film;
   for (int i = 0; i < 100; i++)
   {
       m[i] = film.fileOpen();
   }
   string title;
   cout << " Enter the movie keywords to be searched: ";
   cin >> title;
   for (int i = 0; i < 100; i++)
   {
       if (title == m[i].FilmTitle)
       {
           cout << " Hi " << title << " present in the top "
               "100 movie list. It is at the " << i << " rank ";
       }
   }
}


//Method to search by studio names
void FilmDatabase::searchStudio()
{
   struct MovieData m[100];
   FilmDatabase film;
   for (int i = 0; i < 100; i++)
   {
       m[i] = film.fileOpen();
   }
   string st;
   cout << " Enter the Studio name to be searched: ";
   cin >> st;
   for (int i = 0; i < 100; i++)
   {
       if (st == m[i].Studio)
       {
           cout << " Hi " << st << " present in the top 100"
               " movie list. It is at the " << i << " rank ";
       }
   }
}
void FilmDatabase::searchMonthRelease()
{
   //struct MovieData film[100];
   struct MovieData m[100];
   FilmDatabase film;
   for (int i = 0; i < 100; i++)
   {
       m[i] = film.fileOpen();
   }
   string month;
   cout << " Enter the movie Title to be searched: ";
   cin >> month;
   for (int i = 0; i < 100; i++)
   {
       if (month == m[i].FilmTitle)
       {
           cout << " In " << month << " present in the list."
               " The movie released in this month is at " << i << " rank";
       }
   }
}
//Method to sort the database by movie Titles
void Movie::sortTitleReport()
{
   struct MovieData m[100];
   FilmDatabase film;
   for (int i = 0; i < 100; i++)
   {
       m[i] = film.fileOpen();
   }
   int i, j;
   cout << "Movie Names in alphabetical order : ";
   for (i = 0; i<5; i++)
   {
       cout << m[i].FilmTitle << " ";
   }
}

Project1.cpp

//Include required library files
#include "stdafx.h"
#include<iostream>
#include<stdio.h>
#include<string>
#include<fstream>

//use namespace
using namespace std;

//Start the main method
int main()
{
   Movie film;
   FilmDatabase data;
   Menu opt;
   struct MovieData m[100];
   char menu, choice;
  
   //Starts do-while loop
   do
   {
       //Accepts the menu to display the choices to the user
       char ch = opt.getmenu();

       //starts switch case
       switch (ch)
       {
           //case D to describe about the project
       case 'D':
           //method to describe about the working of project
           menu = film.describe();
           break;

           //Case R to describe about the Report
       case 'R':
           do
           {
               //method to display choices while displaying reports
               menu = opt.getReport();

               //Method to start switch case
               opt.setReport(menu);

               //Display message to continue do-while loop
               cout << " Do you want to continue (Y/N) : ";
               cin >> choice;
           } while (choice != 'N');
           break;

           //Case S to search in the movie database
       case 'S':
           do
           {
               //method to display choices while searching
               menu = opt.getSearch();

               //Method to start switch case
               opt.setSearch(menu);

               //Display message to continue do-while loop
               cout << " Do you want to continue (Y/N) : ";
               cin >> choice;
           } while (choice != 'N');
           break;
           //case X to exit
       case 'X':
           exit(1);
           break;
       default:
           cout << "Enter choice correctly : ";
       }
       //Display message to continue do-while loop
       cout << " Do you want to continue (Y/N) : ";
       cin >> choice;
   } while (choice != 'N');

   //Pause the system for a while
   system("pause");

   //return 0
   return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote