Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 8 pages
Exam (elaborations)

COSC 1436 STUDY GUIDE EXAM QUESTIONS AND ANSWERS GRADED A+

Document preview thumbnail
Preview 2 out of 8 pages

COSC 1436 STUDY GUIDE EXAM QUESTIONS AND ANSWERS GRADED A+

Content preview

COSC 1436 STUDY GUIDE EXAM QUESTIONS AND
ANSWERS GRADED A+
✔✔The expression static_cast<int>(6.9) + static_cast<int>(7.9) evaluates to ____. -
✔✔13

✔✔The length of the string "computer science" is ____ - ✔✔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, ____. - ✔✔one = 10.5, two =
30.6

✔✔Suppose that count is an int variable and count = 1. After the statement count++;
executes, the value of count is ____. - ✔✔2

✔✔Suppose that alpha and beta are int variables. The statement alpha = --beta; is
equivalent to the statement(s) ____. - ✔✔beta = beta - 1;
alpha = beta;

✔✔Suppose that alpha and beta are int variables. The statement alpha = beta++; is
equivalent to the statement(s) ____. - ✔✔alpha = beta;
beta = beta + 1;

✔✔Suppose that alpha and beta are int variables. The statement alpha = ++beta; is
equivalent to the statement(s) ____. - ✔✔beta = beta + 1;
alpha = beta;

✔✔Choose the output of the following C++ statement:
cout << "Sunny " << '\n' << "Day " << endl; - ✔✔Sunny
Day

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

✔✔Consider the following code.

// Insertion Point 1

using namespace std;
const float PI = 3.14;

int main()
{
//Insertion Point 2

, float r = 2.0;
float area;
area = PI * r * r;

cout << "Area = " << area <<endl;
return 0;
}
// Insertion Point 3

In this code, where does the include statement belong? - ✔✔insertion point 1

✔✔____ are executable statements that inform the user what to do. - ✔✔prompt lines

✔✔The declaration int a, b, c; is equivalent to which of the following? - ✔✔int a,b,c;

✔✔Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After the
statement alpha *= beta; executes, ____. - ✔✔alpha = 50

✔✔Suppose that sum and num are int variables and sum = 5 and num = 10. After the
statement sum += num executes, ____. - ✔✔sum = 15

✔✔When reading data into a char variable, after skipping any leading whitespace
characters, the extraction operator >> finds and stores only the next character; reading
stops after a single character. - ✔✔True

✔✔If input failure occurs in a C++ program, the program terminates immediately and
displays an error message. - ✔✔False

✔✔In an output statement, each occurrence of endl advances the cursor to the end of
the current line on an output device. - ✔✔False

✔✔You can use the function getline to read a string containing blanks. - ✔✔True

✔✔Suppose that x and y are int variables. Which of the following is a valid input
statement? - ✔✔cin >> x >> y;

✔✔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; - ✔✔alpha = 17, ch = 'A'

Document information

Uploaded on
October 31, 2025
Number of pages
8
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$12.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
BOARDWALK
3.5
(41)
Sold
283
Followers
10
Items
32850
Last sold
1 week ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions