How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Raj Your Own Question

Raj
Raj, Engineer
Category: Homework
Satisfied Customers: 1257
Experience:  4 + Experiance in IT Industry
Type Your Homework Question Here...
Raj is online now
A new question is answered every 9 seconds

1. (TCO 4) What is the bit pattern in data after the following

Customer Question

1. (TCO 4) What is the bit pattern in data after the following statements execute?
unsigned int data = 10;
data = data | 0x0B;
data = data << 1; (Points : 7)
0x314
0x154
0x342
0x156


2. (TCO 4) What is the value of data after the following code executes?
unsigned char data = 0xA5;
data = data & 0xF0; (Points : 7)
0xA0
0xF0
0xF5
0x5A


3. (TCO 4) What is wrong with the following switch statement?
switch(x)
{
case 0:
cout << x;
case 2:
cout << 2 / x;
break;
default:
cout << “error”;
break;
} (Points : 7)
The value of x could be something other than 1 or 2.
There is no break statement for case 1.
There is no semicolon after the closing bracket.
All of the above


4. (TCO 4) A variable declared before and outside all function blocks (Points : 7)
is visible only in main.
is visible to all functions.
is visible to all functions except main.
is not visible to any functions.


5. (TCO 4) C++ selection statements include
(Points : 7)
for, while, do-while.
cout and cin.
if, if-else, if-else if, switch.
#include and using namespace std;.


6. (TCO 4) Which operation in the following expression will be performed first?
c = a++ / b + 5; (Points : 7)
a
a/b
assignment to c
b + 5


7. (TCO 4) How many elements does the following array contain?
double data [100] [500]; (Points : 7)
500
100
600
50,000


8. (TCO 4) The code below computes the length of a C-style string. What should the value of FLAG be?
char name[20]= "Lancilot";
int length=0;
while(name[length] != FLAG)
{
length = length+1;
}
cout << length << endl; (Points : 7)
‘\0’
20
NULL
0


9. (TCO 4) Given the following code to fill an array,
int;
int data[100];
for(int i = 0; i <= X; i++)
data = i;
what should the value of X be? (Points : 7)
100
101
99
i


10. (TCO 4) Given the following code fragment, what is the data type of thisStudent?
struct student
{
string name;
double gpa;
};
student thisStudent; (Points : 7)
string
const pointer to student
student
double


11. (TCO 4) Which of the following is an invalid declaration to overload the following function?
double foo(int); (Points : 7)
double foo(double);
int foo(int);
double foo(double *):
double foo(int *);


12. (TCO 4) Which of the following statements call the following function correctly?
int MultiplyValues (int, int); (Points : 7)
int a = MultiplyValues (int x, int y);
int a = MultiplyValues (10, 20);
double d = MultiplyValues (int 10, int 20);
All of the above


13. (TCO 4) What is the output of the following code?
void func(int x[ ])
{
x[0] = x[0] * 3;
x[1[ = x[1] * 3;
x[2] = x[2] * 3;
}
void main ()
{
int x[ ] = {1, 2, 3};
func(x);
cout << x[0] << “ “ << x[1] << “ “ << x[2] << endl;
} (Points : 7)
1 2 3
3 4 5
3 6 9
3 3 3


14. (TCO 4) Which of the following function definitions uses pass-by-values? (Points : 7)
int myFunc( int * x, int * y );
int myFunc( int x, int y ) ;
int myFunc( int & x, int & y ) ;
int myFunc( int @ value1, int @ value2 ) ;


15. (TCO 4) Which of the following is called automatically each time an object is created? (Points : 7)
Compiler
Builder
Constructor
Destructor


16. (TCO 4) Creating one class from another in a parent/child hierarchy is an example of (Points : 7)
encapsulation.
polymorphism.
inheritance.
abstraction.


17. (TCO 4) A Distance class has two private members, ‘feet’, of type int, and ‘inches’, of type double. Which prototype correctly declares the copy constructor for such class? (Points : 7)
Distance Distance(const Distance &);
Distance(const Distance &);
int Distance(int, double);
Distance(feet, inches);


18. (TCO 4) Composition is typically an example of (Points : 7)
a “has a” relationship.
an “is a” relationship.
a “uses a” relationship.
a “is used” relationship.


19. (TCO 4) What is the name of a member function of a class that only accesses the value(s) of member variable(s) and does not modify the value(s)? (Points : 7)
Set
Private
Member
Accessor


20. (TCO 4) A derived class is typically an example of (Points : 7)
a “has a” relationship.
an “is a” relationship.
a “uses a” relationship.
a “is used” relationship.


21. (TCO 4) When writing a class, the compiler automatically creates some support functions for the class. What are some of these functions? (Points : 7)
Assignment operator function
Copy constructor
Submitted: 1 year ago.
Category: Homework
Expert:  Raj replied 1 year ago.
Hi there,

How much time is left for the questions to be answered.
And can you please post all the question once again?

Thank you
Customer: replied 1 year ago.

I have an hour left;


1. (TCO 4) What is the bit pattern in data after the following statements execute?
unsigned int data = 10;
data = data | 0x0B;
data = data << 1; (Points : 7)
0x314
0x154
0x342
0x156


2. (TCO 4) What is the value of data after the following code executes?
unsigned char data = 0xA5;
data = data & 0xF0; (Points : 7)
0xA0
0xF0
0xF5
0x5A


3. (TCO 4) What is wrong with the following switch statement?
switch(x)
{
case 0:
cout << x;
case 2:
cout << 2 / x;
break;
default:
cout << “error”;
break;
} (Points : 7)
The value of x could be something other than 1 or 2.
There is no break statement for case 1.
There is no semicolon after the closing bracket.
All of the above


4. (TCO 4) A variable declared before and outside all function blocks (Points : 7)
is visible only in main.
is visible to all functions.
is visible to all functions except main.
is not visible to any functions.


5. (TCO 4) C++ selection statements include
(Points : 7)
for, while, do-while.
cout and cin.
if, if-else, if-else if, switch.
#include and using namespace std;.


6. (TCO 4) Which operation in the following expression will be performed first?
c = a++ / b + 5; (Points : 7)
a
a/b
assignment to c
b + 5


7. (TCO 4) How many elements does the following array contain?
double data [100] [500]; (Points : 7)
500
100
600
50,000


8. (TCO 4) The code below computes the length of a C-style string. What should the value of FLAG be?
char name[20]= "Lancilot";
int length=0;
while(name[length] != FLAG)
{
length = length+1;
}
cout << length << endl; (Points : 7)
‘\0’
20
NULL
0


9. (TCO 4) Given the following code to fill an array,
int;
int data[100];
for(int i = 0; i <= X; i++)
data = i;
what should the value of X be? (Points : 7)
100
101
99
i


10. (TCO 4) Given the following code fragment, what is the data type of thisStudent?
struct student
{
string name;
double gpa;
};
student thisStudent; (Points : 7)
string
const pointer to student
student
double


11. (TCO 4) Which of the following is an invalid declaration to overload the following function?
double foo(int); (Points : 7)
double foo(double);
int foo(int);
double foo(double *):
double foo(int *);


12. (TCO 4) Which of the following statements call the following function correctly?
int MultiplyValues (int, int); (Points : 7)
int a = MultiplyValues (int x, int y);
int a = MultiplyValues (10, 20);
double d = MultiplyValues (int 10, int 20);
All of the above


13. (TCO 4) What is the output of the following code?
void func(int x[ ])
{
x[0] = x[0] * 3;
x[1[ = x[1] * 3;
x[2] = x[2] * 3;
}
void main ()
{
int x[ ] = {1, 2, 3};
func(x);
cout << x[0] << “ “ << x[1] << “ “ << x[2] << endl;
} (Points : 7)
1 2 3
3 4 5
3 6 9
3 3 3


14. (TCO 4) Which of the following function definitions uses pass-by-values? (Points : 7)
int myFunc( int * x, int * y );
int myFunc( int x, int y ) ;
int myFunc( int & x, int & y ) ;
int myFunc( int @ value1, int @ value2 ) ;


15. (TCO 4) Which of the following is called automatically each time an object is created? (Points : 7)
Compiler
Builder
Constructor
Destructor


16. (TCO 4) Creating one class from another in a parent/child hierarchy is an example of (Points : 7)
encapsulation.
polymorphism.
inheritance.
abstraction.


17. (TCO 4) A Distance class has two private members, ‘feet’, of type int, and ‘inches’, of type double. Which prototype correctly declares the copy constructor for such class? (Points : 7)
Distance Distance(const Distance &);
Distance(const Distance &);
int Distance(int, double);
Distance(feet, inches);


18. (TCO 4) Composition is typically an example of (Points : 7)
a “has a” relationship.
an “is a” relationship.
a “uses a” relationship.
a “is used” relationship.


19. (TCO 4) What is the name of a member function of a class that only accesses the value(s) of member variable(s) and does not modify the value(s)? (Points : 7)
Set
Private
Member
Accessor


20. (TCO 4) A derived class is typically an example of (Points : 7)
a “has a” relationship.
an “is a” relationship.
a “uses a” relationship.
a “is used” relationship.


21. (TCO 4) When writing a class, the compiler automatically creates some support functions for the class. What are some of these functions? (Points : 7)
Assignment operator function
Copy constructo


Assignment operator and copy constructor


None of the above


 


22. (TCO 4) Given the definition of
some class called Employee, which of the following correctly dynamically
allocates an array of 20 Employee objects?


Employee * myData = new Employee[20];


Employee myData[20] = new Employee[20];


Employee = myData[20];


Employee array = new Employee[20];


 


23. What is the output of the following code snippet?
int value = 10;
int *
iptr = &value;
*iptr = 5;
Cout << *iptr << “ “ <<
value;


5 5


10 10


5 10


10 5


 


24. What is the output of the following code snippet?
int *p;
int *q;
p =
new int;
*p = 43;
q = p;
*q = 52;
p = new int;
*p = 78;
q =
new int;
*q = *p;
cout << *p << " " << *q << end1


 


4352


5278


7878


7852

Expert:  Raj replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.

Expert:  Raj replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3121
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3035
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2457
    Registered Nurse, Internet Researcher, Private Tutor
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2341
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1975
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1873
    Bachelors Degree and CPA with Accounting work experience