Which of the following functions correctly condenses the body of can_vote () appearing directly below.
Bool Person::can_vote(int year) const {
Int the_age = age(year) ;
/* VOTE_AGE is a private data member of Person class*/
Return the_age >= VOTE_AGE;
}
A) bool Person::can_vote(int year) const {
return age(year) >= the_age;
}
B) bool Person::can_vote(int year) const {
return age(year) >= VOTE_AGE;
}
C) bool Person::can_vote(int year) const {
return the_age >= age(year) ;
}
D) bool Person::can_vote(int year) const {
return the_age >= VOTE_AGE;
}
Correct Answer:
Verified
Q12: Which keyword should you insert in the
Q13: In the code segment below, the modifier
Q14: A constructor differs from a member function
Q15: If we want to allow a class
Q16: In the context of the function header
Q18: The expression _ is a reference to
Q19: A test that demonstrates that certain requirements
Q20: One way to make code reusable is
Q21: If the data fields in a C++
Q22: The classes that declare the data fields
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents