fork download
  1. //Cecilia Rangel CSC5 Chapter 11, #1
  2. //
  3. /**************************************************************
  4.  *
  5.  * COMPUTE MOVIE DATA
  6.  * ____________________________________________________________
  7.  * This program uses a structure named MovieData
  8.  * to store information about a movie. The program
  9.  * should create two variables, store values in
  10.  * their members, and pass each one to a function
  11.  * that displays the information about the movie.
  12.  *_____________________________________________________________
  13.  *
  14.  * OUTPUT
  15.  * words : OUTPUT the movie data
  16.  *
  17.  * ***************************************************************/
  18.  
  19. #include <iostream>
  20. #include <iomanip>
  21. using namespace std;
  22.  
  23. struct MovieData
  24. {
  25. string title;
  26. string director;
  27. int yearReleased;
  28. int runningType;
  29. };
  30.  
  31. void DisplayInfo(MovieData, MovieData);
  32.  
  33. int main()
  34. {
  35. MovieData movieOne = {"Rock", "Fred", 2017, 123};
  36. MovieData movieTwo = {"Water", "Frank", 2016, 143};
  37. DisplayInfo(movieOne, movieTwo);
  38. return 0;
  39. }
  40.  
  41. void DisplayInfo(MovieData movieOne, MovieData movieTwo)
  42. {
  43. cout << "Title: " << movieOne.title << endl;
  44. cout << "Director: " << movieOne.director << endl;
  45. cout << "Year Released: " << movieOne.yearReleased << endl;
  46. cout << "Running Time: " << movieOne.runningType << endl;
  47. cout << "Title: " << movieTwo.title << endl;
  48. cout <<"Director: " << movieTwo.director << endl;
  49. cout << "Year Released: " << movieTwo.yearReleased << endl;
  50. cout << "Running Time: " << movieTwo.runningType << endl;
  51. }
Success #stdin #stdout 0s 544KB
stdin
Standard input is empty
stdout
Title: Rock
Director: Fred
Year Released: 2017
Running Time: 123
Title: Water
Director: Frank
Year Released: 2016
Running Time: 143