Problem #8: [] Consider the code below: class ABSTRACT { ... }; ~ABSTRACT(); is
ID: 3552618 • Letter: P
Question
Problem #8: []
Consider the code below:
class ABSTRACT { ... };
~ABSTRACT();
is the header for the class _________________ .
Problem #10: []
Consider the class diagram below.
+------------------------------+
| class STUFF |
| |
| +---------------------+ |
| | int x; | |
| +---------------------+ |
| +---------------------+ |
| | set_P(int val); | |
| +---------------------+ |
| |
|----------+ +----------------|
| STUFF(); | | int p; |
|----------+ +----------------|
| |
+------------------------------+
STUFF Q;
Write the body of the default constructor, which initializes
member variable p to 75, and member variable x to 0.
NOTE: Write the body ON ONE LINE, enclosed in { }.
Problem #21: []
Consider the declarations below:
string T;
char S[21];
cin >> T;
Write the statement(s) to store the value of string T into C-string S, if
string T contains 20 characters.
NOTE: DO NOT use { }.
Problem #22: []
Consider the declarations below:
char S[21];
cin >> S;
Write the statement(s) to print out the word SHORT if the length of string S
is 8 or less.
NOTE: DO NOT use { }.
DO NOT insert a new line.
Explanation / Answer
((8))
Destructor
---------------------------------------------------------------------------------------------------------------------------------------------
((10))
---------------------------------------------------------------------------------------------------------------------------------------------
((21))
---------------------------------------------------------------------------------------------------------------------------------------------
((22))
if(strlen(S)<=8) cout<<"SHORT";
-------------------------------------------------------------------Finished--------------------------------------------------------------
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.