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
g100num [7]
3 years ago
10

Write a program that prompts the user for input and allows all of these member data values to be specified. The program should c

reate two MovieData variables and create/use a method displayMovie(MovieData) to display the information about the movie in a clearly formatted manner.
Computers and Technology
1 answer:
erma4kov [3.2K]3 years ago
3 0

Answer:

The program to this question can be defined as follows:

Program:

#include <iostream> //defining header file

using namespace std;

struct MovieData  //defining structure MovieData

{

//defining structure variables

string Title; //defining string variable

int Year; //defining integer variable

string Timing; //defining string variable

};

void displayMovie(MovieData M_data) //defining method displayMovie

{

//print values

cout << "Title: "<<M_data.Title<<endl;

cout << "year: "<<M_data.year<<endl;

cout << "Timing: "<<M_data.Timing<<endl;

}

int main () //defining main method

{

MovieData z1,z2; //creating structure variables

cout<<"\t \t Enter First Movie Details:"<<endl; //message

cout << "Enter Title: ";//message

cin>>z1.Title; //input value

cout << "Enter Year: "; //message

cin>>z1.Year; //input value

cout << "Enter Timing: "; //message

cin>>z1.Timing;//input value

cout<<"\t \t Enter Second Movie Details: "<<endl;

cout << "Enter Title: "; //message

cin>>z2.Title;//input value

cout << "Enter Year: "; //message

cin>>z2.Year;//input value

cout << "Enter Timing: "; //message

cin>>z2.Timing;//input value

cout<<"\t\t Movies Detail:"<<endl; //message

displayMovie(z1); //calling a method

displayMovie(z2); //calling a method

return 0;

}

Output:

   Enter First Movie Details:

Enter Title: DDLJ

Enter Year: 2004

Enter Timing: 9to12am

   Enter Second Movie Details:  

Enter Title: RRR

Enter Year: 2010

Enter Timing: 12to3am

  Movies Detail:

Title: DDLJ

Year: 2004

Timing: 9to12am

Title: RRR

Year: 2010

Timing: 12to3am

Explanation:

In the above program a structure "MovieData" is defined, which is used to collect different type of values, inside the structure three variable "Title, Year, and Timing" is declared, in which "Title and Timing" is a string variable and Year is an integer variable.

  • In the next step, a method "displayMovie" is defined, in which we pass a structure object, which is "M_data", that prints the structure details.
  • In the main method two structure variable "z1, and z2" is declared, which take input in the structure variable and call the displayMovie method.
You might be interested in
Computer viruses often spread by means of what?
lozanna [386]
Email attachments hope this helps
8 0
3 years ago
Read 2 more answers
Which of the following does not reflect the second step of effective communication?
Ilya [14]

Answer:

c

Explanation:

3 0
3 years ago
Read 2 more answers
A disadvantage of using hydroelectric power is:
siniylev [52]
Hydroelectric power doesn't pollute water or add anything to it,
it doesn't use wind for its operation, and it doesn't emit anything
into the air.   It does, however, disrupt the river ecosystem.
3 0
4 years ago
Which is an example of a student practicing ethical behavior online??
professor190 [17]

Answer:

Zohar abides by his school’s Internet policy and does not visit questionable websites.

Explanation:

Only the first one is ethical behavior. The second choice is an example of plagiarism. The third & fourth choices could be examples of cyberbullying.  

4 0
4 years ago
Read 2 more answers
A bicycle lane is shown by a soild white line along either side of the street,____or more fett from the curb
marysya [2.9K]
1) do you mean feet and 
2) if its is feet the answer is 3
7 0
3 years ago
Other questions:
  • Different between ocular and compound miscroscope
    13·1 answer
  • Using powerpoint 2016, ethan develops a short five-slide presentation for his marketing project. â â powerpoint files consist of
    6·1 answer
  • How do you enter the command prompt on Chromebook
    10·1 answer
  • Now let's create a memo. The memo should include all parts of a memo, and these parts should appear in the correct order. In you
    9·1 answer
  • Match the expenses to their respective categories.
    6·2 answers
  • Someone knows a good compiler for iPad? It has to be an app
    10·1 answer
  • The Klez virus was a worm created to "spoof others. What is "spoofing"?
    6·1 answer
  • What is the primary difference among a domain model, an analysis model, and a design model for the same project?
    15·1 answer
  • First Computers and Technology question in 4 years..
    11·1 answer
  • Information technology student Roberta has been assigned a project on how to detect unwanted outgoing attacks. Which step is par
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!