100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSC 101 Final Review Exam |Questions with 100% Correct Answers $13.00   Add to cart

Exam (elaborations)

CSC 101 Final Review Exam |Questions with 100% Correct Answers

 1 view  0 purchase
  • Course
  • CSC 101
  • Institution
  • CSC 101

CSC 101 Final Review Exam |Questions with 100% Correct Answers

Preview 3 out of 18  pages

  • October 30, 2024
  • 18
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CSC 101
  • CSC 101
avatar-seller
Examsplug
CSC 101 Final Review Exam
|Questions with 100% Correct
Answers
11 Suppose that sales is an array of 50 components of type double. Which of the
following correctly initializes the



array sales? - ✔ ✔ for (int j = 0; j <= 49; j++)

sales[j] = 0.0;



12 Suppose that list is an array of 10 components of type int. Which of the following
codes correctly outputs all the



elements of list? - ✔ ✔ for (int j = 0; j <= 9; j++)

cout << list[j] << " ";
cout << endl;


12 What is the output of the following C++ code?


int list[5] = {0, 5, 10, 15, 20};
int j;


for (j = 0; j < 5; j++)

,cout << list[j] << " ";

cout << endl; - ✔ ✔ 0 5 10 15 20


12 What is the value of alpha[2] after the following code executes?


int alpha[5];
int j;


for (j = 0; j < 5; j++)

alpha[j] = 2 * j + 1; - ✔ ✔ 5


What is the output of the following C++ code?


int alpha[5] = {2, 4, 6, 8, 10};
int j;


for (j = 4; j >= 0; j--)
cout << alpha[j] << " ";

cout << endl; - ✔ ✔ 10 8 6 4 2



12 Consider the following declaration int alpha[5] = {3, 5, 7, 9, 11};. Which of the following
is equivalent to this



statement? - ✔ ✔ int alpha[] = {3, 5, 7, 9, 11};



12 Consider the following declaration int alpha[3];. Which of the following input
statements correctly inputs values

, into alpha? - ✔ ✔ cin >> alpha[0]

>> alpha[1]
>> alpha[2];



12 In C++, the null character is represented as ____. - ✔ ✔ '\0'



127. Which of the following correctly declares name to be a character array and
stores "William" in it? - ✔ ✔ char name[8] = "William";



12 Consider the following declaration char str[15];. Which of the following statements stores
"Blue Sky" into str? - ✔ ✔ strcpy(str, "Blue Sky");


12 Consider the following declaration.
char charArray[51];
char discard;


Assume that the input is:
Hello There!
How are you?


What is the value of discard after the following statements execute?


cin.get(charArray, 51);

cin.get(discard); - ✔ ✔ discard = '\n'


Consider the following statement: double alpha[10][5];. The number of components of alpha is
____. - ✔ ✔ 50

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Examsplug. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $13.00. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

83637 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$13.00
  • (0)
  Add to cart