1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
weeeeeb [17]
3 years ago
8

Write a function to prompt the user to enter the information for one movie (title, release date, mpaa rating and number of stars

). This function should then return the movie information back to main. You should call this function twice, once for each of the MovieInfo variables in main.

Computers and Technology
1 answer:
allsm [11]3 years ago
4 0

Answer:

Complete code is given and the output is attached also

Explanation:

#include <iostream>

#include <iomanip>

#include <list>

#include <iterator>

using namespace std;

/*

1. You will need to create a structure named MovieInfo that contains the following information about a movie:

title (string) - title of the movie

release date (string)

mpaa rating (string) - G, PG13, PG, R, NC17

number of stars (double) - out of 5

*/

struct MovieInfo

{

string title; //- title of the movie

string releaseDate ; //

string mpaaRating; // rating - G, PG13, PG, R, NC17

double numberOfStars; // of stars (1 out of 5)

};

/*

3. Write a function to prompt the user to enter the information for one movie (title, release date, mpaa rating and number of stars). This function should then return the movie information back to main. You should call this function twice, once for each of the MovieInfo variables in main.

Note: After you read the number of stars, you will need to use cin.get() or cin.ignore() to get rid of the end of line character prior to the next call to getline in your program

cout << "Enter the number of stars the movie received : ";

cin >> movie.numberOfStars;

cin.get();

*/

MovieInfo promptForMovieInformationAndReturn(){

MovieInfo movie;

cout<<"Enter the title of movie : ";

getline (cin,movie.title);

cout<<"Enter the release date of movie : ";

getline (cin,movie.releaseDate);

cout<<"Enter the mpaa rating of movie : ";

getline (cin,movie.mpaaRating);

cout << "Enter the number of stars the movie received : ";

cin >> movie.numberOfStars;

cin.get();

cout<<endl;

return movie;

}

/*

4. Write a function to display a list of movie recommendations that contains only the movies with 4 or more stars. The list of recommendations should include:

a title - Movie Recommendations

movie name

number of stars (formatted so you have 1 place after the decimal point)

You will need to use an if .. else if statement to display either both movies, one movie, or a message that you have no recommendations.

*/

void displayListOfMovieRecommendations(list<MovieInfo> movies){

list <MovieInfo> :: iterator it;

cout<<setw(16)<<left<<"*******************************"<<endl;

cout<<setw(16)<<left<<" Movie Recommendations "<<endl;

cout<<setw(16)<<left<<"*******************************"<<endl;

for(it = movies.begin(); it != movies.end(); ++it) {

if(it->numberOfStars >= 4 ){

cout <<setw(16)<<left<< it->title<<setw(16)<<left<<setprecision(2)<< it-> numberOfStars <<endl;

}

}

}

int main() {

/*

2. The main program will create two MovieInfo variables, for example movie1 and movie2.

*/

MovieInfo movie1;

MovieInfo movie2;

movie1 = promptForMovieInformationAndReturn();

movie2 = promptForMovieInformationAndReturn();

list <MovieInfo> movies;

movies.push_back(movie1);

movies.push_back(movie2);

displayListOfMovieRecommendations(movies);

}

You might be interested in
Question 2 of 10
NeTakaya

Answer:

D.

Because you said it was.

3 0
2 years ago
Which of these is the function of a modeler?
Liono4ka [1.6K]

Answer:

Create 3D assets from sketches

Explanation:

A modeler Job is to model all of the 3D/2D assets needed to obtain the final result wanted by the developers. The modeler creates the assets from sketches or images provided to him according to the theme.

5 0
3 years ago
Read 2 more answers
In file hashing, a file is read by a special algorithm that uses the value of the bits in the file to compute a single number ca
Zielflug [23.3K]

Answer:

Option (B) i.e., Hash is the correct option.

Explanation:

A hash value is the number that has the fixed length and the data recognition is uniquely. It is also a type of file that is read by the special type algo, it uses the value of the bits in the following computer files which is used to manipulates the single number. That's why the following option is correct.

7 0
4 years ago
Malcolm is part of a team developing a new smartphone app to track traffic patterns. Because team members are located throughout
Umnica [9.8K]

Answer:

Virtual team

Explanation:

A virtual team is also known as a remote team, where every member of the team is working from different geographic locations. Usually, the communication channel is through voice/video conferencing or email.

Each member of the team is given unique roles and these roles are delivered optimally within the specified time frame.

For instance, Malcolm does not meet with other members of the team, yet they are working on a project (a smartphone app to track traffic patterns). Following standards that would have applied if they were working at a specific location.

Thanks to Information and Communication Technology (ICT), virtual jobs are on the increase, providing jobs to a lot of people not minding their geographic location.

7 0
3 years ago
Java question
skad [1K]

Answer:

To be honest why would you want to enter one character. Anyways the answer is option 4

6 0
3 years ago
Other questions:
  • Mark, David, Tia, and Ashley are team members in a computer programming class. They have been assigned the task of creating a co
    12·1 answer
  • Which of the following describes an acceptable print resolution?
    7·1 answer
  • The control programs managing computer hardware and software perform the _________ function to control and prioritize tasks perf
    8·1 answer
  • How should you mark the query if it is a valid one?
    9·1 answer
  • Hey guys im just curious.... whats ur favorite number
    6·2 answers
  • Do like TikTok??????
    14·2 answers
  • When proposing a plan in detail for video production phases, fundraising, and outreaching, which section will you use to make su
    14·2 answers
  • Which online note-taking device allows students to clip a page from a website and reuse it later?
    13·2 answers
  • What do you think will happen as more traditional jobs disappear due to technology? Will new jobs take their place?
    13·1 answer
  • Full meaning of CASE in system analysis
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!