Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please Question 31 (10 points) The structure Car is declared as follows: struct Car { string carMake; string carModel; int yearModel: double cost; );

C++ please
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Question 31 (10 points) The structure Car is declared as follows: struct Car \{ string carMake; string carModel; int yearModel: double cost; ); Write the statement that will define a Car structure variable called FordModels and initialized it with the following data in ONE line of code: Make: Ford Model: Mustang Year Model: 1968 Cost: $20,000 Define an array of 5 elements of the Car structure called USCars. Insert in to the USCars array the following data: Question 34 (10 points) Code the statements that will create a class called Student. The class will have 2 member functions: FullName - It is a string that will hold a students full name like "Tom Hays" Age - It is an integer that will hold the students current age like 35. Create the private variables in the class and the Accesssor and Mutator member functions (the get and set) for both of these private variables. Write a loop that will step through the array you defined in the previous question, displaying the contents of each element. Using the Student class you just defined in the previous question code the statement that will instantiate the class. The variable name should be MyStu. Question 36 (10 points) Using the MyStu object you just defined in the previous question code the statement that will store the following values: Student full name: Tom Hays Student age: 35 Question 37 (10 points) Using the MyStu object you just used in the previous question code the statement that will display to the screen the following information from the Student class. The output should look like this: The students name is: Tom Hays The students age is: 35

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions