Question
Question 1 Assuming x is an integer and it is initial value is 2, what is the output of the following code: cout < <
Question 1
Assuming x is an integer and it is initial value is 2, what is the output of the following code:
cout << !x;
:0
undefin ed
2 1
Scope resolution can be used to define a function outside its class.
:True
Fals e
Can a compound data type contains a fundamental data type and another compund data type?
: Yes
it is allowed in C not in C++
It is only allowed if the fundamental data type is not bool
No
Which of the following function will be used once this call is made? display(1,2);
: void display(int *x);
void display(int x, int y=1);
void display(int x, int y, float z);
void display(int x, int y, int z, int q);
Which of the following is a valid member function definition for a struct abc?
: struct abc { int a; float b; float display() }; void abc::display(int a, int b){ return a+b;}
This study source was downloaded by 100000826814308 from CourseHero.com on 09-21-2021 01:18:57 GMT -05:00
Question 3
Question 4
Question 5
https://www.coursehero.com/file/100470342/oop244-quiz-1docx/
Question 2
This study resource was shared via CourseHero.com
void abc::display(int a, int b); void abc::display(int, int);
What is the default access level for class members?
: public private
private for the variables and public for the functions
private for the functions and public for the variables
Given the following segment of code:
const int NG = 20; class Student { ng;
void set(int, const float*, int); Student harry;
Which of the following is a valid call?
: harry.display.n g;
cout << harry.no;
cout << harry.ng;
harry.display.n o;
Question 6
Question 7
Question 8
What is the purpose of the following call? cin.ignore();
: discards one character
discard up to the first end line character
discards all the buffer
What is the output of the following code?
cout.width(3);
cout << 1 << endl;
This study source was downloaded by 100000826814308 from CourseHero.com on 09-21-2021 01:18:57 GMT -05:00
Question 9
https://www.coursehero.com/file/100470342/oop244-quiz-1docx/
int no;
void display() const; };
public: int
float grade[NG];
This study resource was shared via CourseHero.com
Question 10
Only public member functions has direct access to all members of its class.
:True
Fals e
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started