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
Olenka [21]
3 years ago
13

Write a program that uses a structure named MovieData to store the following information about a movie: Title Director Year Rele

ased Running Time (in minutes) The program should create two MovieData variables, store values in their members, and pass each one, in turn, to a function that displays the information about the movie in a clearly formatted manner.
Computers and Technology
1 answer:
Len [333]3 years ago
7 0

Answer:

#include <iostream>

#include <string>

using namespace std;

struct MovieData {

string Title;

string Director;

unsigned short YearReleased;

unsigned short RunningTime;

};

void displayMovieInfo(MovieData &md) {

cout << "The Title is: " << md.Title << endl

<< "The Director is: " << md.Director << endl

<< "The Year of Release: " << md.YearReleased << endl

<< "The Running Time: " << md.RunningTime << " minutes" << endl;

}

int main() {

MovieData firtMovie, secondMovie;

firtMovie.Title = "Starship Troopers";

firtMovie.Director = "Paul Verhoeven";

firtMovie.YearReleased = 1997;

firtMovie.RunningTime = 129;

secondMovie.Title = "Alien vs. Predator";

secondMovie.Director = "Paul W. S. Anderson";

secondMovie.YearReleased = 2004;

secondMovie.RunningTime = 108;

cout << endl;

displayMovieInfo(movFirst);

cout << endl;

displayMovieInfo(movSecond);

cout << endl;

system("pause");

return 0;

}

Explanation:

In this program a structure that contains the class feilds for four attributes of a movie (Title, Director, Year Released and Running Time) we declared this with their appropriate data types.

Next we create a function (Method) called displayMovieInfo that will print a clearly formatted output of the movies when called and given appropriate parameters.

Finally we create the main function where we create two movie objects and make function calls to the displayMovieInfo and pass the two movies to the displayMovieInfo function to display their information

You might be interested in
Consider an unpipelined or single-stage processor design like the one discussed in slide 6 of lecture 17. At the start of a cycl
pantera1 [17]

Answer:

a. Clock Speed of Processor = 0.5 GHz

b. Cycles per Instruction (CPI) = 1 Clock per Instruction

c. Throughput = 1 billion Instruction per Second

Explanation

Given Data

Time Take to complete the single Cycle = 2000ps = 2000 x 10⁻¹²

To Find

a. Clock Speed of Processor = ?

b. Cycles per Instruction (CPI) = ?

c. Throughput = ?

Solution:

a. Clock Speed of Processor = ?

Clock Speed = 1/Time to complete the cycle

                      = 1/2000 x 10⁻¹²  Hz

                      =  0.0005 x 10¹²  Hz

                      =  0.5 x 10⁹  Hz                             as   10⁹ = 1 Giga   so,

                      = 0.5 GHz

b. Cycles per Instruction (CPI) = ?

It is mentioned that, each instruction should start at the start of the new cycle and completely processed at the end of that cycle so, we can say that Cycles per Instruction (CPI) = 1

for above mentioned processor.

c. Throughput = ?

Throughput = CPI x Clock Speed

where

CPI = 1 cycle per instruction

Clock Speed = 1 billion Instructions per Second

as

Clock Speed = 1 billion Cycles per Second

Throughput = 1 cycle per instruction x 1 billion Cycles per Second

Throughput = 1 billion Instruction per Second

                         

6 0
3 years ago
There is an interface I that has abstract class AC as its subclass. Class C inherits AC. We know that C delegates to an object o
Aloiza [94]

Answer:

are u in HS or college work

I am trying to understand

6 0
2 years ago
______ is a certification program that recognizes sustainable building practices and strategies. Question 1 options: A) Brundtla
Pani-rosa [81]

Answer:

(C) LEED

Explanation:

LEED certification is a recognized worldwide as symbol of viability achievement.

(Leadership in Energy and Environmental Design(LEED):- It is the most popular and widely used rating system in the world for green buildings. Available for almost all building project types, including new constructions to interior fit-outs.

8 0
4 years ago
How do I cancel my membership or Subscription on here
timurjin [86]

Answer:

You don't

Explanation:

7 0
3 years ago
The int function can convert floating-point values to integers, and it performs rounding up/down as needed.
omeli [17]

Answer:

Thks is true the int function changes a float value to an integer and will round up or down by default.

5 0
2 years ago
Other questions:
  • 1. JAVA Create one method to do the following expressions. Given the following declarations, what is the result of each of the e
    13·1 answer
  • Identify the false statement.
    8·1 answer
  • True/False: When you make a function call, the order of the arguments you send does not matter as long as the number of argument
    15·1 answer
  • Where does a computer store it’s information
    11·1 answer
  • It is a small hand tool used generally in decorative works such as making garnishes
    15·1 answer
  • Calculate the change in RGDP if the MPC is .6 and initial spending is $500,000.
    8·1 answer
  • Given an char variable last that has been initialized to a lowercase letter, write a loop that displays all possible combination
    8·1 answer
  • I need the answers. i don’t get this
    11·1 answer
  • What is the appropriate source to find information about an organization?
    12·1 answer
  • In your own opinion how comes the surface grinding machine is called a highly accurate machine tool?​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!