Question: 1) Declare a structure with a type name: Car containing: - ReportingMark a string of 5 or less upper case characters - Carnumber an int

1) Declare a structure with a type name: Car containing:

- ReportingMark a string of 5 or less upper case characters

- Carnumber an int

- Kind could be box tank flat or other

- loaded a bool

- Destination a string with a destination or the word NONE

A destination is required if the car is loaded. If it is not loaded the destination may be either a destination or the word NONE.

Create the following functions: main * Uses new to obtain space for the data structure * Calls the other two functions * Deletes the space obtained using new input * Read all the data from the user * After all the data has been read, put all this data into the structure output * Print the data in a neat format

Put the main function first. Use the function names and field names specified above. Arrange the functions in the order listed above. Test your program with the following data: reporting Mark SP, car Number 34567, kind box, loaded true, destination Salt Lake City

2) Repeat problem 1 with the following changes:

Use class rather than struct with the type name: Car Make the data in the class Car public. Revise the input so the input function will only read the data from the user, and then it will call an additional function named setUpCar which will put the data in the object. Test with the same data.

Step by Step Solution

3.52 Rating (145 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To tackle this we need a comprehensive approach to creating a structure and a class in C as specified Ill guide you through solving this stepbystep Pa... View full answer

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

Document Format (2 attachments)

PDF file Icon

6092575265937_22931.pdf

180 KBs PDF File

Word file Icon

6092575265937_22931.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!