Given the following struct definitions, what is the correct way to print the month a movie was released? struct Date {    int day;    int month;    int year; }; struct Movie {    int starRating;    Date releaseDate; };   Movie movie;

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 16RQ
icon
Related questions
Question

Given the following struct definitions, what is the correct way to print the month a movie was released?

struct Date
{
   int day;
   int month;
   int year;
};

struct Movie
{

   int starRating;
   Date releaseDate;
};

 
Movie movie;

Expert Solution
Introduction

The structure data type:

The structure is a user-defined data type that can contain the collection of different data types including primitive data types like integer, float, or characters and non-primitive type structures, union, or classes.

The structure data type can be defined with the struct keyword. The syntax of the structure is defined as follows

struct structureName{

 datatype variableName;

 datatype variableName;

};

The values of the variableName can be set by the variable of the structure.

structureName(dot). variableName=value;

 

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT