No
A) Point center;
B) center.x = 12;
C) center.y = 7;
D) cout «_space;center.x «_space;endl;
cout «_space;center.y «_space;endl;
A) FullName info;
B) info.lastName = “Smith”;
info.middleName = “Bart”;
info.firstName = “William”;
C) cout «_space;info.lastName «_space;endl;
cout «_space;info.middleName «_space;endl;
cout «_space;info.firstName «_space;endl;
A) “Canton”
B) “Haywood”
C) 9478
D) uninitialized
structure Rectangle
{
int length;
int width;
};
Rectangle *r = nullptr
Write statements that
A) Dynamically allocate a Rectangle structure variable and use r to point to it.
B) Assign 10 to the structure’s length member and 14 to the structure’s width member.
A) r = new Rectangle;
B) r->length = 10;
r->width = 14;
8 bytes
0 1 2
A) valid
B) invalid
C) valid
D) invalid
E) valid
F) valid
G) valid
declared
tag
members
semicolon
tag
dot
struct Car
{
string carMake;
string carModel;
int yearModel;
double cost;
};
Write a definition statement that defines a Car structure variable initialized with the following data:
Make: Ford
Model: Mustang
Year Model: 1968
Cost: $20,000
const int SIZE = 25;
Car collection[SIZE];
const int SIZE = 35;
Car forSale[SIZE] = {
{“Ford”, “Taurus”, 1997, 21000},
{“Honda”, “Accord”, 1992, 11000},
{“Lamborghini”, “Countach”, 1997, 200000} };
for (int x = 0; x < SIZE; x++)
{
cout «_space;forSale[x].carMake «_space;endl;
cout «_space;forSale[x].carModel «_space;endl;
cout «_space;forSale[x].yearModel «_space;endl;
cout «_space;forSale[x].cost «_space;endl «_space;endl;
}
struct TempScale
{
double fahrenheit;
double centigrade;
};
struct Reading
{
int windSpeed;
double humidity;
tempScale temperature;
};
Reading today;
today.windSpeed = 37;
today.humidity = .32;
today.temperature.fahrenheit = 32;
today.temperature.centigrade = 0;