Test
C++ classes and linked lists questions
Preguntas del test (4)
1How many members (data and functions) does the following class have?
{
public:
Rational()
Rational(int, int)
Rational(int)
int getN();
int getD();
friend void display();
private:
int
int- A6
- B7
- C2
- D3
2What is wrong with the following overloaded extraction operator declaration?
istream& operator >>(istream& in, const myClass &object);- Aa. You cannot put the & on the return type
- Bb. Object should not be a pass by reference parameter
- Cc. Object should not be a const parameter
- Dd. nothing
3As defined in the text, the pointer variable head
- Aa. points to the first node in the list.
- Bb. is the first node in the list.
- Cc. is always NULL.
- Dd. is undefined.
4Which of the following loops correctly uses iter as an iterator to move through the
nodes of the linked list?- Aa. for(iter=NULL; iter != NULL; iter=iter->link)
- Bb. for( iter=head; iter != NULL; iter=iter->link)
- Cc. while(iter!=NULL)
iter=iter->link - Dd. while(iter!=NULL)
iter++
Información
- Descripción
- Test sobre Sin título, creado por Adam Fisher el 06/04/2017.
- Autor
- Adam Fisher
- Idioma
- English
- Visitas
- 0
- Valoración
- Aún sin valoraciones Valora este test