Exam 1: C++ Basics

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

With C++11 and higher what data type can you use to guarantee that 32 bits will be used to store a signed integer?

Free
(Essay)
4.7/5
(31)
Correct Answer:
Verified

The type int32_t will allocate 32 bits for an integer.The size of a regular int may vary (e.g.16,32,or 64 bits)depending upon the underlying machine architecture.

In the history of the C++ language,what was the immediate predecessor of the C++ language? How is this older language related to C++?

Free
(Essay)
4.8/5
(31)
Correct Answer:
Verified

The immediate predecessor of C++ is the C programming language.C is very nearly a proper subset of C++.

The C++ very nearly contains the ______ programming language as proper subset.

Free
(Short Answer)
4.9/5
(34)
Correct Answer:
Verified

(the)C (programming language)

A program should have a comment on every line.

(True/False)
4.8/5
(35)

Which of the following will properly encode the string "\w\\\t" into variable s?

(Multiple Choice)
4.9/5
(44)

Comments have no value whatsoever and do not belong in a program.

(True/False)
4.8/5
(29)

In C++ you can assign an expression of type double to a variable of type int with no problem.

(True/False)
4.9/5
(41)

Identifiers should at least give a hint to the human reader of the ________________ of the identifier in the context of the problem being solved.

(Short Answer)
4.8/5
(33)

To put a character into a cstring constant that causes the output to continue on the next line,insert the escape sequence \t into the string constant.

(True/False)
4.7/5
(34)

A computer program is a set of instructions intended for only the computer to follow.

(True/False)
4.9/5
(37)

Give the declaration for two variables,feet and inches.Declare each to be of type int,and both initialized to zero in the declaration.Give both initialization alternatives.

(Essay)
4.7/5
(30)

C++ not only supports OOP but also supports other programming styles.

(True/False)
4.8/5
(39)

What is the difference between a warning from the compiler and an error message from the compiler?

(Essay)
4.8/5
(43)

A C++ declaration introduces only an identifier's spelling and specifies its type.

(True/False)
5.0/5
(41)

Write a C++ program that outputs "My first C++ program" and then outputs a carriage return.

(Essay)
4.9/5
(39)

The range of values for an int variable is from about 0 to +2 billion.

(True/False)
4.7/5
(33)

In C++ you can assign an expression of type int to a variable of type double with no problem.

(True/False)
4.8/5
(31)

Write a short program that contains statements to output the values of a variable that you define but neither initialize nor assign.Discuss the output you get.

(Essay)
4.8/5
(36)

In C++ the compiler will infer the type intended for a variable from the context in which the variable occurs.

(True/False)
4.8/5
(38)

OOP is an acronym that means Object Oriented Programming.

(True/False)
4.9/5
(42)
Showing 1 - 20 of 37
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)