Question

c# questions: 24.The counter variable in a for statement must be declared ___________. a.first b.second c.third...

c# questions:

24.The counter variable in a for statement must be declared ___________.

a.first

b.second

c.third

d.fourth

39.A(n) ___________ variable cannot be referenced outside of the block in which it is declared.

a.scope

b.local

c.restricted

d.restricted global

e.global

54.Attempting to access a private member of a class outside that class ______________.

a.is a run-time error

b.is a syntax error

c.is a logic error

d.can be accomplished using IntelliSense

Homework Answers

Answer #1

24 . The counter variable in a for statement must be declared _

a.first

for example: for(int i; i<n; i++)

If the variable is used without declaration it's a compile time error.

for( i; i<n; i++) will give error if int i; is not used before it.

39.A(n) ___________ variable cannot be referenced outside of the block in which it is declared.

b.local

A variable local to a block can only be accessed within it. Accessing it outside the block where it is defined will give a compile time error.

//if block

if(...){   

int i; //Scope of i starts

...

//Scope of i ends

}

54. Attempting to access a private member of a class outside that class ______________.

b.is a syntax error

A class private member can only be accessed by member functions or the friend functions.

No other object can access it. Else it is a compile time or syntax error.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
What role could the governance of ethics have played if it had been in existence in...
What role could the governance of ethics have played if it had been in existence in the organization? Assess the leadership of Enron from an ethical perspective. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies, collapsed in 2001 under a mountain of debt...
Discuss ethical issues that can be identified in this case and the mode of managing ethics...
Discuss ethical issues that can be identified in this case and the mode of managing ethics Enron finds itself in this case. How would you describe the ethical culture and levels of trust at Enron? Provide reasons for your assessment. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among...
Discuss how the respective organizations’ relations with stakeholders could have potentially been affected by the events...
Discuss how the respective organizations’ relations with stakeholders could have potentially been affected by the events that took place at Enron and how the situation could have been dealt with differently to prevent further damage? THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies,...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT