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);
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
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
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.