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.   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 in support of database queries and reporting using good software engineering principles, an application that interacts with the end-user.  The design is up to you and may include any number of classes in support of the given application.  A Menu class is strongly recommended.     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. Data Details: The database contains data pertaining to the 100 highest grossing films of 2017.  A comma delimited file named Films2017.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.  Therefore, an inorder traversal of the BST will produce the Films in order of title. The menu system consists of a main menu and sub-menus.  All menu choices are selected by entering the letter of the desired choice.  After a selection is processed, the current menu should be re-displayed.  Do NOT use recursion to do this; use a loop.  The current menu continues until the X option (return to main menu or exit) is selected. When the application begins, the following main menu should be displayed:                                                                                   MAIN MENU                                                                             A - About the Application                                                                             R - Reports                                                                             S - Search the Database                                                                             X - Exit the Program                                                                             Enter Selection ->

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please help me with this code in C++, I dont know to write a menu for this. Please help me create a Film.h, Film.cpp, Main, and A Menu. thank you!!

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.  

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 in support of database queries and reporting using good software engineering principles,
  • an application that interacts with the end-user.  The design is up to you and may include any number of classes in support of the given application.  A Menu class is strongly recommended.    

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.

Data Details:

The database contains data pertaining to the 100 highest grossing films of 2017.  A comma delimited file named Films2017.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.  Therefore, an inorder traversal of the BST will produce the Films in order of title.

The menu system consists of a main menu and sub-menus.  All menu choices are selected by entering the letter of the desired choice.  After a selection is processed, the current menu should be re-displayed.  Do NOT use recursion to do this; use a loop.  The current menu continues until the X option (return to main menu or exit) is selected.

When the application begins, the following main menu should be displayed:

                                                                                  MAIN MENU
                                                                            A - About the Application
                                                                            R - Reports
                                                                            S - Search the Database
                                                                            X - Exit the Program

                                                                            Enter Selection ->

BinaryTreeADT.H:

#ifndef BINARYTREEADT_H
#define BINARYTREEADT_H

template <class T>
class BinaryTreeADT {
public:
    virtual bool isEmpty() const = 0;
    virtual bool add(const T& newItem) = 0;
    virtual bool remove(const T& delItem) = 0;
    virtual void clear() = 0;
    virtual bool contains(const T& findItem) const = 0;

    virtual void inorderTraverse(void visit(T&)) const = 0;
private:

};

#endif /* BINARYTREEADT_H */

BinarySearchTree.H:

#ifndef BINARYSEARCHTREE_H
#define BINARYSEARCHTREE_H

#include "BinaryTreeADT.h"
#include "BinaryNode.h"

template <class T>
class BinarySearchTree : BinaryTreeADT<T> {
public:
    BinarySearchTree();
    BinarySearchTree(const BinarySearchTree& orig);
    virtual ~BinarySearchTree();
    
    //interface methods
    bool isEmpty() const;
    bool add(const T& newItem);
    bool remove(const T& delItem);
    void clear();
    bool contains(const T& findItem) const;
    
    void inorderTraverse(void visit(T& item)) const;
    
 
private:
    BinaryNode<T>* root;
    
    //recursive methods
    void destroyTree(BinaryNode<T>* currRoot);
    BinaryNode<T>* copyTree(const BinaryNode<T>* currRoot) const;
    BinaryNode<T>* placeNode(BinaryNode<T>* currRoot, BinaryNode<T>* newNode);
    bool findNode(BinaryNode<T>* currRoot, const T& item) const;
    void inorder(BinaryNode<T>* currRoot, void visit(T& item)) const;
};

#include "BinarySearchTree.cpp"
#endif /* BINARYSEARCHTREE_H */

BinaryNode.H:

#ifndef BINARYNODE_H
#define BINARYNODE_H

template <class T>
class BinaryNode {
public:
    BinaryNode();
    BinaryNode(const T& newItem,
            BinaryNode<T>* left = nullptr, 
            BinaryNode<T>* right = nullptr);
    BinaryNode(const BinaryNode& orig);
    virtual ~BinaryNode();
    
    T getItem() const;
    void setItem(const T& newItem);
    
    BinaryNode<T>* getLeftChild() const;
    BinaryNode<T>* getRightChild() const;
    
    void setLeftChild(BinaryNode<T>* left);
    void setRightChild(BinaryNode<T>* right);
    
    bool isLeaf() const;
    
private:
    T item;
    BinaryNode<T>* leftChild;
    BinaryNode<T>* rightChild;
};

#include "BinaryNode.cpp"
#endif /* BINARYNODE_H */

 

Enclude "BinarylNode.h"
include <cstddef>
include <iostream>
emplate <class T>
inaryNode<T>::BinaryNode() : leftChild(nullptr), rightChild(nullptr) {
cemplate <class T>
BinaryNodecT>::BinaryNode(const T& newItem,
BinaryNodecT> left, BinaryNode<T> right) :
item(newItem), leftChild(left), rightChild(right) {
template <class T>
Binaryllode<T>::BinaryNode(const BinaryNodes orig) {
item - orig.item;
leftChild - orig.leftChild;
rightChild - orig.rightChild;
template <class T>
BinaryNodecT>::-BinaryNode() {
//
std::cout « this->getItem().getRanking() « - node destroyed" << std::endl;
template <class T>
T BinaryNodecT>::getItem() const (
return item;
template <class T>
void Binaryllode<T>::setItem(const T& newItem) {
item - newItem;
template cclass T>
BinaryNodecT> BinarylodecT>::getLeftChild() const{
return leftChild;
template <class T>
BinaryNode<T> Binarylode<T>::getRightChild() const (
return rightChild;
template <class T>
void BinaryNodecT>::setleftChild(Binarytiode<T> left) (
leftChild - left;
template <class T>
void BinarylodecT>:setRightChild(BinaryNodecT> right) (
rightChild - right;
template <class T>
bool BinaryliodecT>: :isLeaf() const {
return (leftChild -- nullptr && rightChild -- nullptr);
Transcribed Image Text:Enclude "BinarylNode.h" include <cstddef> include <iostream> emplate <class T> inaryNode<T>::BinaryNode() : leftChild(nullptr), rightChild(nullptr) { cemplate <class T> BinaryNodecT>::BinaryNode(const T& newItem, BinaryNodecT> left, BinaryNode<T> right) : item(newItem), leftChild(left), rightChild(right) { template <class T> Binaryllode<T>::BinaryNode(const BinaryNodes orig) { item - orig.item; leftChild - orig.leftChild; rightChild - orig.rightChild; template <class T> BinaryNodecT>::-BinaryNode() { // std::cout « this->getItem().getRanking() « - node destroyed" << std::endl; template <class T> T BinaryNodecT>::getItem() const ( return item; template <class T> void Binaryllode<T>::setItem(const T& newItem) { item - newItem; template cclass T> BinaryNodecT> BinarylodecT>::getLeftChild() const{ return leftChild; template <class T> BinaryNode<T> Binarylode<T>::getRightChild() const ( return rightChild; template <class T> void BinaryNodecT>::setleftChild(Binarytiode<T> left) ( leftChild - left; template <class T> void BinarylodecT>:setRightChild(BinaryNodecT> right) ( rightChild - right; template <class T> bool BinaryliodecT>: :isLeaf() const { return (leftChild -- nullptr && rightChild -- nullptr);
Bnclude ciostrea
Enclud inaryiearchtree.
plate lass
inarytearchtreeTinaryearshfreet) root(lptr) (
onglate elassT
arybearchfreect ryearchfreetcot rytetree ori)
00 cmpy all sodes to create tree
:0out 0or constructor called
roct this-opyfree(orig.root)
shallaw oy prford
mplate oclans
wysearchtreel.(
thielear
wrinterface wetha
plate lass T
oel aryarctree ty) o(
Nture (rot llptr
tmplate clas T
hoel inary
Riarydet den narydecti ton).
routlade(root, e),
Cak(comst 18 it) (
retur tr
tmplate class h
bl inyerctret tatomt 16 tindit) t
reture finde(root, finditon)
mplate class h
hod iryarshtree rett deltt
return false
toplate alas
ved ytrdtre dear (
destrytretn
recars
tolate clas
ret ainaryearchreertioytreetmen iaren coet
uthos
tree echitooyfretotiggh
return nelrew
tmplate las t
bo inaryeahfreectiiotindodrcamdett.commtot, cont te) cot (
llptr)
retum talur;
le if toroteti - t)
Hture true
ele if (t
reure f (o nci.
return finddetoetgin . ti
plate las
atreectiialacmdec t currt, iryedet de
aer)
r tfot
( e a)
colede(carrtot e ,
eling right
ghch,
return cu t
iaryleanhtresbetryre ry t
f Crtot
destreyt urrout.igenc N
delat t
fraverseced vi s t) an (
testectotcnvi, wed vi t
Transcribed Image Text:Bnclude ciostrea Enclud inaryiearchtree. plate lass inarytearchtreeTinaryearshfreet) root(lptr) ( onglate elassT arybearchfreect ryearchfreetcot rytetree ori) 00 cmpy all sodes to create tree :0out 0or constructor called roct this-opyfree(orig.root) shallaw oy prford mplate oclans wysearchtreel.( thielear wrinterface wetha plate lass T oel aryarctree ty) o( Nture (rot llptr tmplate clas T hoel inary Riarydet den narydecti ton). routlade(root, e), Cak(comst 18 it) ( retur tr tmplate class h bl inyerctret tatomt 16 tindit) t reture finde(root, finditon) mplate class h hod iryarshtree rett deltt return false toplate alas ved ytrdtre dear ( destrytretn recars tolate clas ret ainaryearchreertioytreetmen iaren coet uthos tree echitooyfretotiggh return nelrew tmplate las t bo inaryeahfreectiiotindodrcamdett.commtot, cont te) cot ( llptr) retum talur; le if toroteti - t) Hture true ele if (t reure f (o nci. return finddetoetgin . ti plate las atreectiialacmdec t currt, iryedet de aer) r tfot ( e a) colede(carrtot e , eling right ghch, return cu t iaryleanhtresbetryre ry t f Crtot destreyt urrout.igenc N delat t fraverseced vi s t) an ( testectotcnvi, wed vi t
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY