GoConqr has a new look! Let us know what you think.

Quiz

C++ classes and linked lists questions

Adam Fisher 4 questions

Take the quiz

Questions in this quiz (4)

  1. 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
    1. A6
    2. B7
    3. C2
    4. D3
  2. 2What is wrong with the following overloaded extraction operator declaration?
    istream& operator >>(istream& in, const myClass &object);
    1. Aa. You cannot put the & on the return type
    2. Bb. Object should not be a pass by reference parameter
    3. Cc. Object should not be a const parameter
    4. Dd. nothing
  3. 3As defined in the text, the pointer variable head
    1. Aa. points to the first node in the list.
    2. Bb. is the first node in the list.
    3. Cc. is always NULL.
    4. Dd. is undefined.
  4. 4Which of the following loops correctly uses iter as an iterator to move through the
    nodes of the linked list?
    1. Aa. for(iter=NULL; iter != NULL; iter=iter->link)
    2. Bb. for( iter=head; iter != NULL; iter=iter->link)
    3. Cc. while(iter!=NULL)
      iter=iter->link
    4. Dd. while(iter!=NULL)
      iter++

Information

Description
Quiz on Untitled, created by Adam Fisher on 06/04/2017.
Language
English
Views
0
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?