Exam 1: C++ Basics

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

When you use a double,what is doubled? When you use a long int,how much longer is the long int than an int? Comment.

(Essay)
4.8/5
(38)

Given the C++ output statements.What is the output of these lines of code? Explain. cout << "If you have "; cout << "a number of pods "; cout << "you can quit."; cout << "\n";

(Essay)
4.8/5
(36)

If we execute the code fragment in an otherwise complete,correct program: n = 1; cout << n++ << " " << n++ << " " << n++ << endl; the output is guaranteed to be 1 2 3.

(True/False)
4.8/5
(29)

The names x,y,and z are satisfactory variable names for the lengths of the legs and hypotenuse of a triangle.

(True/False)
4.9/5
(36)

What is the value assigned to the variable in each of these cases? Explain curious results.Be careful! int x,y; a)x = 1/2; b)y = 3.0/2.0; double z,w,t; c)z = 1/2; d)w = 3/2; e)t = 3.0/2.0;

(Essay)
4.8/5
(35)

The namespace facility is a tool used that assists in the study of genealogy.

(True/False)
4.9/5
(31)

C++ uses only /* */ for comments.

(True/False)
4.9/5
(42)

The most difficult programming language construct to learn to use properly is the comment.

(True/False)
4.7/5
(41)

Which of the following are likely to be poor choices for an identifier in a program? Why? a)x b)RATE c)data d)_abc e)A

(Essay)
4.8/5
(34)

An r-value is

(Multiple Choice)
4.7/5
(42)

A program's comments should connect the program code to the problem being solved.

(True/False)
4.8/5
(30)

If we execute this code in an otherwise correct and complete program: n = 1; n = (n++)+ (n++); the value of n is guaranteed to be 3 after the second line executes.

(True/False)
4.9/5
(38)

What is the data type of variable x in the following C++11 code: int y= 2; Double z = 3.5; Auto x = z * y;

(Multiple Choice)
4.7/5
(38)

A C++ declaration is a definition that also allocates storage for an identifier's value (or function's body etc. ).

(True/False)
4.9/5
(40)

What does the line #include <iostream> do for your program?

(Essay)
4.7/5
(43)

In C++ the variables Alpha,ALPHA and AlphA are the same identifier.

(True/False)
4.8/5
(37)

In C++,a legal identifiers may contain these kinds of characters _______________,______________,______________

(Short Answer)
4.8/5
(36)
Showing 21 - 37 of 37
close modal

Filters

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