Question: I have : A. struct AutoMobile { int year; string make; double mpg; }; B. AutoMobile car; C, car.year = 2012; car.make = infinity; car.mpg

 I have : A. struct AutoMobile { int year; string make;

I have : A. struct AutoMobile { int year; string make; double mpg; }; B. AutoMobile car; C, car.year = 2012; car.make = "infinity"; car.mpg = 25; D. AutoMobile vehicle[500];

Please provide E-L and I would like to learn if you can please place commentary

Structures Homework 1. Write code to accomplish each of the following: a) Using typedef, declare a structure, Automobile, with the following members: model - string of 25 characters maximum year - integer mpg - integer b) Declare variable car to be of type Automobile. c) Assign the information below to the appropriate fields of variable car: 2012 Infiniti gets 25 mpg. d) Declare an array, vehicle, of 500 Automobiles e) Assign variable car to the 5h element of the array. f) Output the Automobi le information located in the 5th array location. Show the output. g) Declare variable p to be a pointer to an Automobile structure. h) Assign to variable p the address of the 5th array location. ) Using variable p, output the Automobile information located in the 5th array location. Show the output. j) Declare variable q to be a pointer to an Automobile structure. k) Assign to variable q the address of the first array location. ) Using variable q. output the Aut omobi le information located in the 5h array location. Show the output. 5th array Focus on Fundamentals of Programming with C Page 428

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!