CSCI-1380 Study Guide 1

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Suppose that ch1, ch2, and ch3 variables of the type char and the input is: A B C Choose the value of ch3 after the following statements executes: cin >> ch1 >> ch2 >> ch3;

C

True/False- The basic commands that a computer performs are input (get data), output (display result), storage, and performance of arithmetic and logical operations.

True

True/False- The explicit conversion of a value from one data type to another is called type casting.

True

True/False- The extraction operator >> skips only all leading blanks when searching for the next data in the input stream.

True

True/False- The function peek returns the next character in the input stream; it does not remove the character from the input stream.

True

True/False- The maximum number of significant digits in float values is up to 6 or 7.

True

True/False- The operating system monitors the overall activity of the computer and provides services such as memory management, input/output activities, and storage management.

True

True/False- The structured design approach is also known as modular programming.

True

True/False- To develop a program to solve a problem, you start by analyzing the problem.

True

True/False- 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

True/False- The machine language of one machine is the same as the machine language of another machine.

True ?

___ consists of 65,536 characters.

Unicode

Suppose that x = 55.68, y = 476.859, and z = 23.8216. What is the output of the following statements? cout << fixed << showpoint; cout << setprecision(3); cout << x << ' ' << y << ' ' << setprecision(2) << z << endl;

55.680 476.859 23.82

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 statement execute: cin >> alpha; cin >> ch;

Alpha = 17, ch = 'A'

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?

inFile.open("progdata.dat");

True/False- A reserved word can be used as a variable name.

False

True/False- For file input/output in a program, the program must include the header file iofstream.

False

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

False

True/False- In the statement cin >> x;, x can be a variable or an expression.

False

True/False- Information stored in main memory must be transferred to some other device for permanent storage.

False

True/False- It is a good idea to redefine cin and cout in your program.

False

True/False- Manipulators without parameters are part of the header file iomanip.

False

True/False- Suppose x=8. After the execution of the statement y = x++; y is 9 and x is 8.

False

True/False- The devices that feed data and programs into computers are called output devices.

False

True/False- The escape sequence \r moves the insertion point to the beginning of the next line.

False

True/False- The following is a legal C++ identifier: Hello!

False

True/False- Every C++ program must have a function called main.

True

True/False- If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right.

True

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;

300

True/False- In the C++ statement, cin.get(u); u must be a variable of type char.

True

Several categories of computers exist, such as ____.

Mainframe, midsize, and micro

Main memory is called ___.

Random Access Memory (RAM)

Choose the output of the following C++ statement:

Sunny

True/False- A C++ program is processed by the preprocessor before being processed by the compiler.

True

True/False- A sequence of 0s and 1s is sometimes referred to as binary code.

True

True/False- Arithmetic and logical operations are carried out inside the CPU.

True

True/False- Assembly language, COBOL, Pascal, C, C++, and Java are all high-level languages.

True

True/False- Entering a char value into an int variable causes serious errors, called input failure.

True

A step-by-step problem-solving process in which a solution is arrived at in a finite amount of time is called a(n) ____.

algorithm

The digit 0 or 1 is called a binary digit, or ___.

bit

Manipulators without parameters are part of the ____ header file.

iostream

A program called a(n) ___ combines the object program with the programs from libraries.

linker

Main memory is an ordered sequence of items, called ____.

memory cells

___ are executed statement that inform the user what to do.

prompt lines

Suppose that x is an int variable, y is a double variable and ch is a char variable and the input is: 15A 73.2 Choose the values after the following statement executes: cin >> x >> ch >> y;

x = 15, ch = 'A', y= 73.2


Ensembles d'études connexes

Module 2 - OOP Core Concepts and Recursion

View Set

Understanding Animal Biology: Unit 9

View Set

PED Final Exam Course point ?'s Unit 2

View Set

PBHLTH150B everything to know - human health and enviro in a changing world

View Set

Exam 1 - Ch 11, 12 (sepsis, CV surgery) (ch 16: DIC)

View Set

D'accord 3: Leçon 7: À la recherche du progrès

View Set

Advanced Security Practitioner 2

View Set