Question

C++ Cinema Project

IMG-20210611-WA0001.jpg

Project Cinema Assume you're asked to create a database for cinemas in egypt, which contains:

Structure Address\{ String City, Integer StreetNo\}

Structure movie_type\{ String name, string description. integer allowed_age \}

Structure Cinema \{ Long ID. String Name, integer phone_number , Address address, integer rating , integer hall_numbers, movie_type movie\}

Draw a complete flowchart and Write a complete C++ program to do the following:

Takes an array of size 10 from Cinema.

Write a menu for user that contains:

o Press 1 to fill data of database.

o Press 2 to output data in the database

o Press 3 to search on Cinema by Name

o Press 4 to search on Cinema by " 5 " stars rating

o Press 5 to search on Cinema by names of viewing movies

o Press 6 to search on Cinema by 10

o Press 7 to search on Cinema in StreetNo "109"

o Press 8 to exit

Use Do \(\cdots\) While to restart menu.

0 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1
Flowchart
Function Main Declare Integer choice Assign choice = 0 1- True While choice!=8 False Output MENU Input choice False True If
C++ Program
1. #include <iostream> 2. 3. #define t_size 10 4. 5. using namespace std; 6. 7. struct Address 8. { 9. string City; 10. int S
#include 

#define t_size 10

using namespace std;

struct Address
{
  string City;
  int StreetNo;
};

struct movie_type
{
  string name;
  string description;
  int allowed_age;
};

struct Cinema
{
  long ID;
  string Name;
  long long int phone_number;
  struct Address address;
  int rating;
  int hall_numbers;
  struct movie_type movie;
};

void FillData(struct Cinema* cinema, int c_index)
{
  cout< < endl< < "Please enter the following details"< < endl;
  cout< < "ID: ";
  cin>>cinema[c_index].ID;
  cout< < "Name: ";
  cin>>cinema[c_index].Name;
  cout< < "Phone Number: ";
  cin>>cinema[c_index].phone_number;
  cout< < "City: ";
  cin>>cinema[c_index].address.City;
  cout< < "Street Number: ";
  cin>>cinema[c_index].address.StreetNo;
  cout< < "Rating: ";
  cin>>cinema[c_index].rating;
  cout< < "Hall Numbers: ";
  cin>>cinema[c_index].hall_numbers;
  cout< < "Movie Name: ";
  cin>>cinema[c_index].movie.name;
  cout< < "Movie Description: ";
  cin>>cinema[c_index].movie.description;
  cout< < "Allowed Age in Movie: ";
  cin>>cinema[c_index].movie.allowed_age;
  cout< < endl< < "Data filled Successfully."< < endl;
}

void OutData(struct Cinema* cinema, int c_index)
{
  cout< < "ID: "< < cinema[c_index].ID;
  cout< < "\tName: "< < cinema[c_index].Name;
  cout< < endl< < "Phone Number: "< < cinema[c_index].phone_number;
  cout< < endl< < "City: "< < cinema[c_index].address.City;
  cout< < "\tStreet Number: "< < cinema[c_index].address.StreetNo;
  cout< < endl< < "Rating: "< < cinema[c_index].rating;
  cout< < "\tHall Numbers: "< < cinema[c_index].hall_numbers;
  cout< < endl< < "Movie Name: "< < cinema[c_index].movie.name;
  cout< < endl< < "Movie Description: "< < cinema[c_index].movie.description;
  cout< < endl< < "Allowed Age in Movie: "< < cinema[c_index].movie.allowed_age;
  cout< < endl< < endl;
}

int SearchByName(struct Cinema* cinema, int c_size, string Name)
{
  int found=0;
  for(int i=0;i>choice;

    if(choice==1)
    {
      if(c_size>search_item;
      int found=SearchByName(cinema, c_size, search_item);
      if(found==0)
      {
        cout< < endl< < "Not Found!!!"< < endl;
      }

    }
    else if(choice==4)
    {
      int search_item;
      cout< < "Enter rating to search on Cinema: ";
      cin>>search_item;
      int found=SearchByRating(cinema, c_size, search_item);
      if(found==0)
      {
        cout< < endl< < "Not Found!!!"< < endl;
      }
       
    }
    else if(choice==5)
    {
      string search_item;
      cout< < "Enter Viewing Movie Name to search on Cinema: ";
      cin>>search_item;
      int found=SearchByMovieName(cinema, c_size, search_item);
      if(found==0)
      {
        cout< < endl< < "Not Found!!!"< < endl;
      }
       
    }
    else if(choice==6)
    {
      long search_item;
      cout< < "Enter ID to search on Cinema: ";
      cin>>search_item;
      int found=SearchByID(cinema, c_size, search_item);
      if(found==0)
      {
        cout< < endl< < "Not Found!!!"< < endl;
      }
       
    }
    else if(choice==7)
    {
      int search_item;
      cout< < "Enter Street Number to search on Cinema: ";
      cin>>search_item;
      int found=SearchByStreetNo(cinema, c_size, search_item);
      if(found==0)
      {
        cout< < endl< < "Not Found!!!"< < endl;
      }
       
    }
    else if(choice==8)
    {
       cout< < endl< < "Thankyou!!!"< < endl;
    }
    else
    {
      cout< < endl< < "Invalid Choice!!! Please Try Again!!!"< < endl;
    }


  }while(choice!=8);
  
  
  return 0;
}

> Thank you so much!
Can you please send an image link for the flowchart because it doesn't come out clear when I open or save it

Reim Fri, Jun 18, 2021 5:57 AM

Add a comment
Know the answer?
Add Answer to:
C++ Cinema Project
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • WONT COMPILE ERROR STRAY / TEXT.H AND CPP PROGRAM SAYING NOT DECLARED HAVE A DRIVER WILL...

    WONT COMPILE ERROR STRAY / TEXT.H AND CPP PROGRAM SAYING NOT DECLARED HAVE A DRIVER WILL PASTE AT BOTTOM MOVIES.CPP #include "movies.h" #include "Movie.h" Movies *Movies::createMovies(int max) { //dynamically create a new Movies structure Movies *myMovies = new Movies; myMovies->maxMovies = max; myMovies->numMovies = 0; //dynamically create the array that will hold the movies myMovies->moviesArray = new Movie *[max]; return myMovies; } void Movies::resizeMovieArray() { int max = maxMovies * 2; //increase size by 2 //make an array that is...

  • Need this in C++ Goals: Your task is to implement a binary search tree of linked...

    Need this in C++ Goals: Your task is to implement a binary search tree of linked lists of movies. Tree nodes will contain a letter of the alphabet and a linked list. The linked list will be an alphabetically sorted list of movies which start with that letter. MovieTree() ➔ Constructor: Initialize any member variables of the class to default ~MovieTree() ➔ Destructor: Free all memory that was allocated void printMovieInventory() ➔ Print every movie in the data structure in...

  • [C++] Outline: The movie data is read from a file into an array of structs and...

    [C++] Outline: The movie data is read from a file into an array of structs and is sorted using the Selection Sort method and the search is done using the Binary Search algorithm with the year of release as key. This assignment upgrades to an array of pointers to the database elements and converts the Selection Sort and Binary search procedure on the database to selection sort and binary search on the array of pointers to the database.   Requirements: Your...

  • Coding in c++

    I keep getting errors and i am so confused can someone please help and show the input and output ive tried so many times cant seem to get it. main.cpp #include <iostream> #include <vector> #include <string> #include "functions.h" int main() {    char option;    vector<movie> movies;     while (true)     {         printMenu();         cin >> option;         cin.ignore();         switch (option)         {            case 'A':            {                string nm;                int year;                string genre;                cout << "Movie Name: ";                getline(cin, nm);                cout << "Year: ";                cin >> year;                cout << "Genre: ";                cin >> genre;                               //call you addMovie() here                addMovie(nm, year, genre, &movies);                cout << "Added " << nm << " to the catalog" << endl;                break;            }            case 'R':            {                   string mn;                cout << "Movie Name:";                getline(cin, mn);                bool found;                //call you removeMovie() here                found = removeMovie(mn, &movies);                if (found == false)                    cout << "Cannot find " << mn << endl;                else                    cout << "Removed " << mn << " from catalog" << endl;                break;            }            case 'O':            {                string mn;                cout << "Movie Name: ";                getline(cin, mn);                cout << endl;                //call you movieInfo function here                movieInfo(mn, movies);                break;            }            case 'C':            {                cout << "There are " << movies.size() << " movies in the catalog" << endl;                 // Call the printCatalog function here                 printCatalog(movies);                break;            }            case 'F':            {                string inputFile;                bool isOpen;                cin >> inputFile;                cout << "Reading catalog info from " << inputFile << endl;                //call you readFromFile() in here                isOpen = readFile(inputFile, &movies);                if (isOpen == false)                    cout << "File not found" << endl;...

  • PLEASE COMPLETE THE CODES. package javaprogram; import java.io.PrintStream; import java.util.ArrayList; import java.util.Scanner; /** * Movie class...

    PLEASE COMPLETE THE CODES. package javaprogram; import java.io.PrintStream; import java.util.ArrayList; import java.util.Scanner; /** * Movie class definition. * * @author David Brown * @version 2019-01-22 */ public class Movie implements Comparable { // Constants public static final int FIRST_YEAR = 1888; public static final String[] GENRES = { "science fiction", "fantasy", "drama", "romance", "comedy", "zombie", "action", "historical", "horror", "war" }; public static final int MAX_RATING = 10; public static final int MIN_RATING = 0; /** * Converts a string of...

  • C++ A sample project is provided AverageGrade that is very similar to the MovieRatings project, but...

    C++ A sample project is provided AverageGrade that is very similar to the MovieRatings project, but it only is inputting one string (className) instead of both the movie name and the MPAA rating. Another difference is that the AverageGrade program scores grades A to F with point values from 4.0 to 0.0 (highest to lowest) while the MovieRatings scores the rating from 1 to 5 (lowest to highest). When using the AverageGrade program as a reference, make sure that the...

  • Need help for C program. Thx #include <stdio.h> #include <string.h> #include <ctype.h> // READ BEFORE YOU...

    Need help for C program. Thx #include <stdio.h> #include <string.h> #include <ctype.h> // READ BEFORE YOU START: // This homework is built on homework 06. The given program is an updated version of hw06 solution. It begins by displaying a menu to the user // with the add() function from the last homework, as well as some new options: add an actor/actress to a movie, display a list of movies for // an actor/actress, delete all movies, display all movies,...

  • SQL Queries – in this assignment you will be asked to create several SQL queries relating...

    SQL Queries – in this assignment you will be asked to create several SQL queries relating to the Sakila database that we installed in class. You may freely use DBeaver to create these queries, but I will expect your solution to show me the SQL code to answer or complete the tasks below. Write a query that produces the last name, first name, address, district, and phone number for every customer in the customer table. (You don’t need to include...

  • Files given in this assignment (right-click on the file to download) Assignment7.cpp (need to complete) Student.h...

    Files given in this assignment (right-click on the file to download) Assignment7.cpp (need to complete) Student.h (Given. Just use it, don't change it!) Student.cpp (Partially filled, need to complete) 1. Assignment description In this assignment, you will write a simple class roster management system for ASU CSE100. Step #1: First, you will need to finish the design of class Student. See the following UML diagram for Student class, the relevant header file (class declaration) is given to you as Student.h,...

  • JAVA project PLEASE complete/ create project with comments in the programming explaining everything Text file Year...

    JAVA project PLEASE complete/ create project with comments in the programming explaining everything Text file Year of storm/ Name of storm/ mmdd storm started/ mmdd storm ended/ magnitude of storm/ //made up data 2004/Ali/1212/1219/1 2003/Bob/1123/1222/3 1980/Sarah/0123/0312/0 1956/Michael/1211/1223/4 1988/Ryan/0926/1019/ 1976/Tim/0318/1010/0 2006/Ronald/0919/1012/2 1996/Mona/0707/0723/1 2000/Kim/0101/0201/1 2001/Jim/1101/1201/3 Text file Class storm{ private String nameStorm; private int yearStorm; private int startStorm; private int endStorm; private int magStorm; public storm(String name, int year, int start, int end, int mag){ nameStorm = name; yearStorm = year; startStorm...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT