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
How do you find the exterior angle measure of any regular polygon? (The degree in which to turn the turtle to draw a shape)
Diano4ka-milaya [45]

Answer:

360/number of sides

Explanation:

all the exterior angles add up to 360°

so to find each angle mesure, divide the 360 by the number of sides the figure has.

7 0
3 years ago
write a c++ program that reads from the user a positive integer (in a decimal representation), and prints its binary (base 2) re
Vesna [10]

Answer:

The program to this question can be described as follows:

Program:

#include <iostream> //defining header file

using namespace std;

int main() //defining main method

{

int x1,rem,i=1; //defining integer variable

long Num=0;// defining long variable

cout << "Input a decimal number: "; // print message

cin >> x1; //input value by user

while (x1!=0) //loop for calculate binary number

{

//calculating binary value    

rem= x1%2;

x1=x1/2;

Num =Num +rem*i;//holding calculate value

i=i*10;

}

cout <<Num;//print value

return 0;

}

Output:

Input a decimal number: 76

1001100

Explanation:

In the above code, four variable "x1, rem, i, and Num" is declared, in which three "x1, rem, and i" is an integer variable, and one "Num" is a long variable.

  • In the x1 variable, we take input by the user and use the while loop to calculate its binary number.
  • In the loop, first, we check x1 variable value is not equal to 0, inside we calculate it binary number that store in long "Num" variable, after calculating its binary number the print method "cout" is used to prints its value.  
5 0
3 years ago
when I was playing Mobile legends bang bang online Match The game logged Me out and when I was Trying To reconnect it failed and
Helen [10]

Answer:

it's most prolly a bug.The game crashes a lot tbh

5 0
3 years ago
When I use
slega [8]

Answer:

If it works then no, if it doesn't then yes

Explanation:

Code Academy probably runs either way because it is not taking this as a intense class.

5 0
3 years ago
Which of the following could occur when both strong and weak ciphers are configured on a VPN concentrator? (Select TWO) A. An at
Elza [17]

Answer:

A. An attacker could potentially perform a downgrade attack.

E. The IPSec payload reverted to 16-bit sequence numbers.

Explanation:

When both strong and weak ciphers are configured on a VPN concentrator, the following are likely to occur;

An attacker could potentially perform a downgrade attack

The IPSec payload reverted to 16-bit sequence numbers

3 0
3 years ago
Other questions:
  • what's the best mouse for fast clicking ? I play a lot of fps and a lot of pvp games I need a mouse that I can click fast with a
    14·1 answer
  • Binary code what does this mean I was sick so I don't under stand
    7·2 answers
  • What question should you ask yourself to determine if a story is newsworthy
    11·2 answers
  • Design and implement a class called Sphere that contains instance data that represent the sphere’s diameter. Define the Sphere c
    6·1 answer
  • HELP 11 pointsw to the person who helps me
    11·2 answers
  • Briefly summarize two examples of cybercrime stories.<br> quick pleaseeee
    10·1 answer
  • From the set ( 5 , 7 , 9 , 11 , 13 make the inequality w - 4 &lt; 8 true
    12·1 answer
  • Research the topic of legal and ethical behaviors or dilemmas related to technology. Identify five topics of concern and briefly
    9·1 answer
  • Which app or website teaches java and phyton
    15·1 answer
  • Accenture has put together a coalition of several ecosystem partners to implement the principles of blockchain and Multi-party S
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!