Mixed Up Code Practice

Let’s write the code for the struct definition of Movie. The Movie structure will have the instance variables title, director, and releaseYear in that order. Put the necessary blocks of code in the correct order.

Let’s write the code for the printMovie function. printMovie should print the information about a movie in the following format: “title” directed by director (releaseYear). Put the necessary blocks of code in the correct order.

Let’s write the code for the movieAge function. movieAge should take a Movie and currentYear as a parameter and return how many years it has been since the releaseYear. Put the necessary blocks of code in the correct order.

Let’s write the code for the struct definition of Date. The Date structure will have three integer instance variables: day, month, and year in that order. Put the necessary blocks of code in the correct order.

Let’s write the code for the printDate function. printDate should print the date in the following format: month/date/year. Put the necessary blocks of code in the correct order.

Let’s write the code for the nextMonth function. nextMonth should change the date to one month later. For example, 3/4/2020 gets modified to 4/4/2020, and 12/3/2020 gets modified to 1/3/2021. Put the necessary blocks of code in the correct order.

Let’s write the code for the struct definition of Length. Length should have the instance variables inches, feet, and yard. Put the necessary blocks of code in the correct order.

Let’s write the code for the printLength function. printLength should print the date in the following format: yards yds, feet ft, inches in. Put the necessary blocks of code in the correct order.

Let’s write the code for the allInches function. printLength should modify a Length object to convert all feet and yards to inches. For example, a Length with 1 yard, 2 feet, and 3 inches is converted into a Length with 0 yards, 0 feet, and 63 inches. Put the necessary blocks of code in the correct order.

Let’s write the code for the addLengths function. addLengths should take three Lengths as parameters. It should then add the first two Lengths and store the result in the third Length. If there is over 12 inches or over 3 feet, convert it to the proper amound of feet and yards (13 inches becomes 1 foot and 1 inch). Put the necessary blocks of code in the correct order.

You have attempted of activities on this page