• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 9 pages
Exam (elaborations)

CSCI 240 - Exam 1 Review Questions with Verified Correct Answers

Document preview thumbnail
Preview 2 out of 9 pages

CSCI 240 - Exam 1 Review Questions with Verified Correct Answers

Content preview

CSCI 240 - Exam 1 Review Questions with
Verified Correct Answers
Most lines in a C++ program end with a

semi-colon

main() marks the beginning of a C++ program. What C++ reserved word precedes it?

int

What is the correct way to declare an integer variable named "score"?

int score;

Given the following declaration: double x;

What is the value of x?

Garbage. It has no value

According to the lecture notes, the two main conceptual components of a program are

data and instruction

Given the following:

double price = 30.00;

double tax = 1.80;

double sum;



sum = price + tax



Explain in detail what the last line does in terms of variables, calculations, and

assignment of values

, The last line takes the price and tax, adds them together, and assigns that value to the sum

variable

When you write an illegal C++ statement and try to compile and run the program, you

will get a

compile error

What is the value (in C++) of the expression * 2?

4

What is the value (in C++) of the expression 3/2?

1

Which data type has the largest range?

double

About how many decimal places of accuracy does a float have?

6

Modify (rewrite) the following instruction so that the subtraction is evaluated first:



i = a * b / c - d;

i = a * b / (c - d);

What instruction will display data on the screen from a C++ program?

cout

About how many decimal places of accuracy does a float have?

6

Document information

Uploaded on
August 26, 2026
Number of pages
9
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$11.99

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.
KenAli
2.6
(18)
Sold
114
Followers
5
Items
23937
Last sold
6 days 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