subject

Before the main function, declare a struct called Movie which has title as a string and year as the integer as the member variables. Also before the main function, instantiate an object of Movie called m with initial value "Avengers" as title and year as 2019. Note m is the global variable and A in the title is uppercase. Also before the main function, declare another global variable which is a pointer to the movie object m named ptr and make it point to m.
In the main function, output the title and the year of m to the console separated by a space so that the output is "Avengers 2019" with a new line at the end.
Next in the main function, change the value of m so that the title of m is "Shrek" and the year is 2001 by manipulating ptr only. Again you should do this not using the variable m directly but using the pointer ptr instead.
Now output the value of m again by directly using the variable m. Double check the values got changed. Again, the title and the year should be separated by a space and have a new line at the end. So the new output should be "Shrek 2001" with a new line (note that S is the uppercase)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:10
David is in week 3 of his current ashford course and has a paper due by monday night at midnight. he has finished everything but the concluding paragraph. as he boots up his computer to work on it, he sees a flash across the screen and then the screen goes black. he begins to panic as he tries desperately to turn the laptop back on. david should have saved his work on what kind of portable device?
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
question
Computers and Technology, 24.06.2019 09:30
What is the definition of digital literacy?
Answers: 1
question
Computers and Technology, 24.06.2019 13:10
Write a program that has a conversation with the user. the program must ask for both strings and numbers as input. the program must ask for at least 4 different inputs from the user. the program must reuse at least 3 inputs in what it displays on the screen. the program must perform some form of arithmetic operation on the numbers the user inputs. turn in your .py file as well as a screenshot of your program's output. include comments in your code to explain how it works an example program run might look like (have fun with this and be creative): ‘what is your name? ’ “josh” ‘, josh. what is your favorite color? ’ “green” ‘mine too. do you also like ice cream? ’ “no” ‘josh, how old are you? ’ “40” ‘ and how many siblings do you have? ’’ “3” ‘that means you are one of 4 kid(s). is green the favorite color of anyone else in your house? ’
Answers: 3
You know the right answer?
Before the main function, declare a struct called Movie which has title as a string and year as the...
Questions
question
Mathematics, 24.10.2021 01:00
question
Chemistry, 24.10.2021 01:00
question
Mathematics, 24.10.2021 01:00
question
Social Studies, 24.10.2021 01:00
Questions on the website: 13722363