100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COSC 2436 ALL CHAPTER FINAL EXAM QUESTIONS AND ANSWERS $14.49   Add to cart

Exam (elaborations)

COSC 2436 ALL CHAPTER FINAL EXAM QUESTIONS AND ANSWERS

 7 views  0 purchase
  • Course
  • COSC
  • Institution
  • COSC

COSC 2436 ALL CHAPTER FINAL EXAM QUESTIONS AND ANSWERS

Preview 4 out of 53  pages

  • August 24, 2024
  • 53
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • COSC
  • COSC
avatar-seller
millyphilip
COSC 2436 ALL CHAPTER FINAL EXAM
QUESTIONS AND ANSWERS
The devices that feed data and programs into computers are called ____ devices. -
Answer -input

____ represent information with a sequence of 0s and 1s. - Answer -Digital signals

A sequence of eight bits is called a___________. - Answer -byte

The term GB refers to ___. - Answer -gigabyte

consists of 65,536 characters. - Answer -Unicode

A program called a(n) ____ combines the object program with the programs from
libraries. - Answer -linker

____ is a valid char value. - Answer -'A'

An example of a floating point data type is ____. - Answer -double

The length of the string "computer science" is ____. - Answer -16

In a C++ program, one and two are double variables and input values are 10.5 and
30.6. After the statement cin >> one >> two; executes, ____. - Answer -one = 10.5, two
= 30.6

Which of the following is the newline character? - Answer -\n

Suppose that x is an int variable and y is a double variable and the input is:
10 20.7
Choose the values after the following statement executes: cin >> x >> y;. - Answer -x =
10, y = 20.7

Suppose that alpha is an int variable and ch is a char variable and the input is:
17 A
What are the values after the following statements execute?
cin >> alpha;
cin >> ch; - Answer -alpha = 17, ch = 'A'

,Suppose that ch1, ch2, and ch3 are variables of the type char and the input is:
AB
C
Choose the value of ch3 after the following statement executes:
cin >> ch1 >> ch2 >> ch3; - Answer -'C'

Suppose that x is an int variable, ch is a char variable, and the input is:
276.
Choose the values after the following statement executes:
cin >> ch >> x; - Answer -ch = '276', x = '.'

Suppose that alpha, beta, and gamma are int variables and the input is:
100 110 120
200 210 220
300 310 320
What is the value of gamma after the following statements execute?
cin >> alpha;
cin.ignore(100, '\n');
cin >> beta;
cin.ignore(100,'\n');
cin >> gamma; - Answer -300

Suppose that ch1 and ch2 are char variables and the input is:
WXYZ
What is the value of ch2 after the following statements execute?
cin >> ch1;
ch2 = cin.peek();
cin >> ch2; - Answer -X

Manipulators without parameters are part of the ____ header file. - Answer -iostream

Consider the following program segment.
ifstream inFile; //Line 1
int x, y; //Line 2
... //Line 3
inFile >> x >> y; //Line 4

Which of the following statements at Line 3 can be used to open the file progdata.dat
and input data from this file into x and y at Line 4? - Answer -
inFile.open("progdata.dat");

Suppose that ch1 and ch2 are char variables, alpha is an int variable, and the input is:
A 18
What are the values after the following statement executes?
cin.get(ch1);

,cin.get(ch2);
cin >> alpha; - Answer -ch1 = 'A', ch2 = ' ', alpha = 18

The expression in an if statement is sometimes called a(n) ____. - Answer -decision
maker

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

int x = 35;
int y = 45;
int z;

if (x > y)
z = x + y;
else
z = y - x;

cout << x << " " << y << " " << z << endl; - Answer -35 45 10

When one control statement is located within another, it is said to be ____. - Answer -
nested

What is the output of the following code?

if (6 > 8)
{
cout << " ** " << endl ;
cout << "****" << endl;
}
else if (9 == 4)
cout << "***" << endl;
else
cout << "*" << endl; - Answer -*

Assume you have three int variables: x = 2, y = 6, and z. Choose the value of z in the
following expression: z = (y / x > 0) ? x : y;. - Answer -2

What is the output of the following code?

char lastInitial = 'A';

switch (lastInitial)
{
case 'A':
cout << "section 1" <<endl;
break;

, case 'B':
cout << "section 2" <<endl;
break;
case 'C':
cout << "section 3" <<endl;
break;
case 'D':
cout << "section 4" <<endl;
break;
default:
cout << "section 5" <<endl;
}

SECTION 1

What is the output of the following code?

char lastInitial = 'A';

switch (lastInitial)
{
case 'A':
cout << "section 1" <<endl;
break;
case 'B':
cout << "section 2" <<endl;
break;
case 'C':
cout << "section 3" <<endl;
break;
case 'D':
cout << "section 4" <<endl;
break;
default:
cout << "section 5" <<endl;
}


int x = 55;
int y = 5;

switch (x % 7)
{
case 0:
case 1:
y++;

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 millyphilip. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73091 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
$14.49
  • (0)
  Add to cart