\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{ghostrogue} \pdfinfo{ /Title (programming-fundamentals-i.pdf) /Creator (Cheatography) /Author (ghostrogue) /Subject (Programming Fundamentals I Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Programming Fundamentals I Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{ghostrogue} via \textcolor{DarkBackground}{\uline{cheatography.com/23817/cs/5332/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}ghostrogue \\ \uline{cheatography.com/ghostrogue} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 6th October, 2015.\\ Updated 12th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{2.88666 cm} x{2.09034 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 1}} \tn % Row 0 \SetRowColor{LightBackground} The basic commands that a computer performs are input (get data), output (display result), storage, and performance of arithmetic and logical operations. & T \tn % Row Count 7 (+ 7) % Row 1 \SetRowColor{white} Main memory is directly connected to the CPU. & T \tn % Row Count 9 (+ 2) % Row 2 \SetRowColor{LightBackground} When the computer is turned off, everything in secondary memory is lost. & F \tn % Row Count 13 (+ 4) % Row 3 \SetRowColor{white} The devices that feed data and programs into computers are called output devices. & F \tn % Row Count 17 (+ 4) % Row 4 \SetRowColor{LightBackground} Information stored in main memory must be transferred to some other device for permanent storage. & T \tn % Row Count 22 (+ 5) % Row 5 \SetRowColor{white} The device that stores information permanently (unless the device becomes unusable or you change the information by rewriting it) is called primary storage. & F \tn % Row Count 29 (+ 7) % Row 6 \SetRowColor{LightBackground} The command that does the linking on Visual C++ 2012 Express and Visual Studio 2012 is Make or Remake. & F \tn % Row Count 34 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.88666 cm} x{2.09034 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 1 (cont)}} \tn % Row 7 \SetRowColor{LightBackground} When you compile your program, the compiler identifies the logic errors and suggests how to correct them. & F \tn % Row Count 5 (+ 5) % Row 8 \SetRowColor{white} To develop a program to solve a problem, you start by analyzing the problem. & T \tn % Row Count 9 (+ 4) % Row 9 \SetRowColor{LightBackground} C++ programs have always been portable from one compiler to another. & F \tn % Row Count 12 (+ 3) % Row 10 \SetRowColor{white} Several categories of computers exist, such as \_\_\_\_. & mainframe, midsize, and micro \tn % Row Count 15 (+ 3) % Row 11 \SetRowColor{LightBackground} The basic commands that a computer performs are \_\_\_\_, and performance of arithmetic and logical operations. & input, output, storage \tn % Row Count 20 (+ 5) % Row 12 \SetRowColor{white} Main memory is called \_\_\_\_. & random access memoryq \tn % Row Count 22 (+ 2) % Row 13 \SetRowColor{LightBackground} The \_\_\_\_ is the brain of the computer and the single most expensive piece of hardware in your personal computer. & CPU \tn % Row Count 27 (+ 5) % Row 14 \SetRowColor{white} Main memory is an ordered sequence of items, called \_\_\_\_. & memory cells \tn % Row Count 30 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.88666 cm} x{2.09034 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 1 (cont)}} \tn % Row 15 \SetRowColor{LightBackground} The devices that feed data and programs into computers are called \_\_\_\_ devices. & input \tn % Row Count 4 (+ 4) % Row 16 \SetRowColor{white} The devices that the computer uses to display results are called \_\_\_\_ devices. & output \tn % Row Count 8 (+ 4) % Row 17 \SetRowColor{LightBackground} \_\_\_\_ programs perform a specific task. & Application \tn % Row Count 10 (+ 2) % Row 18 \SetRowColor{white} The \_\_\_\_ monitors the overall activity of the computer and provides services. & operating system \tn % Row Count 14 (+ 4) % Row 19 \SetRowColor{LightBackground} \_\_\_\_ represent information with a sequence of 0s and 1s. & Digital Signals \tn % Row Count 17 (+ 3) % Row 20 \SetRowColor{white} A sequence of eight bits is called a \_\_\_\_. & byte \tn % Row Count 19 (+ 2) % Row 21 \SetRowColor{LightBackground} The digit 0 or 1 is called a binary digit, or \_\_\_\_. & bit \tn % Row Count 22 (+ 3) % Row 22 \SetRowColor{white} The term GB refers to \_\_\_ & gigabyte \tn % Row Count 24 (+ 2) % Row 23 \SetRowColor{LightBackground} \_\_\_\_ consists of 65,536 characters. & Unicode \tn % Row Count 26 (+ 2) % Row 24 \SetRowColor{white} A program called a(n) \_\_\_\_ translates instructions written in high-level languages into machine code. & compiler \tn % Row Count 31 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.88666 cm} x{2.09034 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 1 (cont)}} \tn % Row 25 \SetRowColor{LightBackground} A program called a(n) \_\_\_\_ combines the object program with the programs from libraries. & linker \tn % Row Count 4 (+ 4) % Row 26 \SetRowColor{white} A program that loads an executable program into main memory is called a(n) \_\_\_\_. & loader \tn % Row Count 8 (+ 4) % Row 27 \SetRowColor{LightBackground} A step-by-step problem-solving process in which a solution is arrived at in a finite amount of time is called a(n) \_\_\_\_. & algorithim \tn % Row Count 14 (+ 6) % Row 28 \SetRowColor{white} Dividing a problem into smaller subproblems is called \_\_\_\_ design. & structured \tn % Row Count 17 (+ 3) % Row 29 \SetRowColor{LightBackground} A(n) \_\_\_\_ consists of data and the operations on those data. & object \tn % Row Count 20 (+ 3) % Row 30 \SetRowColor{white} The programming language C++ evolved from \_\_\_\_. & C \tn % Row Count 23 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.83689 cm} x{2.14011 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 2.}} \tn % Row 0 \SetRowColor{LightBackground} The memory allocated for a float value is \_\_\_\_ bytes. & four \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} In C++, reserved words are the same as predefined identifiers. & F \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} The maximum number of significant digits in values of the double type is 15. & T \tn % Row Count 10 (+ 4) % Row 3 \SetRowColor{white} The maximum number of significant digits in float values is up to 6 or 7. & T \tn % Row Count 14 (+ 4) % Row 4 \SetRowColor{LightBackground} An operator that has only one operand is called a unique operator. & F \tn % Row Count 17 (+ 3) % Row 5 \SetRowColor{white} If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right. & T \tn % Row Count 22 (+ 5) % Row 6 \SetRowColor{LightBackground} A mixed arithmetic expression contains all operands of the same type. & F \tn % Row Count 26 (+ 4) % Row 7 \SetRowColor{white} Suppose a = 5. After the execution of the statement ++a; the value of a is 6. & T \tn % Row Count 30 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.83689 cm} x{2.14011 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 2. (cont)}} \tn % Row 8 \SetRowColor{LightBackground} The escape sequence \textbackslash{}r moves the insertion point to the beginning of the next line. & F \tn % Row Count 4 (+ 4) % Row 9 \SetRowColor{white} A comma is also called a statement terminator. & F \tn % Row Count 7 (+ 3) % Row 10 \SetRowColor{LightBackground} Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7; & T \tn % Row Count 12 (+ 5) % Row 11 \SetRowColor{white} The \_\_\_\_ rules of a programming language tell you which statements are legal, or accepted by the programming language. & Syntax \tn % Row Count 18 (+ 6) % Row 12 \SetRowColor{LightBackground} Which of the following is a reserved word in C++? & char \tn % Row Count 21 (+ 3) % Row 13 \SetRowColor{white} Which of the following is a legal identifier? & program\_1 \tn % Row Count 24 (+ 3) % Row 14 \SetRowColor{LightBackground} \_\_\_\_ is a valid int value. & 46259 \tn % Row Count 26 (+ 2) % Row 15 \SetRowColor{white} \_\_\_\_ is a valid char value. & 'A' \tn % Row Count 28 (+ 2) % Row 16 \SetRowColor{LightBackground} An example of a floating point data type is \_\_\_\_ & double \tn % Row Count 31 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.83689 cm} x{2.14011 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 2. (cont)}} \tn % Row 17 \SetRowColor{LightBackground} (2X) The value of the expression 33/10, assuming both values are integral data types, is \_\_\_\_. // The value of the expression 17 \% 7 is \_\_\_\_. & 3 \tn % Row Count 7 (+ 7) % Row 18 \SetRowColor{white} The expression static\_cast(9.9) evaluates to \_\_\_\_ & 9 \tn % Row Count 10 (+ 3) % Row 19 \SetRowColor{LightBackground} The expression static\_cast(6.9) + static\_cast(7.9) evaluates to \_\_\_\_. & 13 \tn % Row Count 14 (+ 4) % Row 20 \SetRowColor{white} The length of the string "computer science" is \_\_\_\_. Question 22 options: & 16 \tn % Row Count 18 (+ 4) % Row 21 \SetRowColor{LightBackground} In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin \textgreater{}\textgreater{} one \textgreater{}\textgreater{} two; executes, \_\_\_\_. & one = 10.5, two = 30.6 \tn % Row Count 25 (+ 7) % Row 22 \SetRowColor{white} Suppose that count is an int variable and count = 1. After the statement count++; executes, the value of count is \_\_\_\_. & 2 \tn % Row Count 31 (+ 6) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.83689 cm} x{2.14011 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 2. (cont)}} \tn % Row 23 \SetRowColor{LightBackground} Choose the output of the following C++ statement: cout \textless{}\textless{} "Sunny " \textless{}\textless{} '\textbackslash{}n' \textless{}\textless{} "Day " \textless{}\textless{} endl; & Sunny Day \tn % Row Count 5 (+ 5) % Row 24 \SetRowColor{white} Which of the following is the newline character? & \textbackslash{}n \tn % Row Count 8 (+ 3) % Row 25 \SetRowColor{LightBackground} \_\_\_\_ are executable statements that inform the user what to do. & prompt lines \tn % Row Count 11 (+ 3) % Row 26 \SetRowColor{white} The declaration int a, b, c; is equivalent to which of the following? & int a,b,c; \tn % Row Count 15 (+ 4) % Row 27 \SetRowColor{LightBackground} Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After the statement alpha *= beta; executes, \_\_\_\_. & alpha = 50 \tn % Row Count 21 (+ 6) % Row 28 \SetRowColor{white} Suppose that sum and num are int variables and sum = 5 and num = 10. After the statement sum += num executes, \_\_\_\_. & sum = 15 \tn % Row Count 27 (+ 6) % Row 29 \SetRowColor{LightBackground} Insertion Point 1 & alpha = beta; beta = beta + 1; \tn % Row Count 29 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 3}} \tn % Row 0 \SetRowColor{LightBackground} It is a good idea to redefine cin and cout in your programs & F \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} In the statement cin \textgreater{}\textgreater{} x; , x can be a variable or an expression & F \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} The following statements will result in input failure if the input values are not on a separate line. (Assume that x and y are int variables.) cin \textgreater{}\textgreater{} x; cin \textgreater{}\textgreater{} y; & F \tn % Row Count 16 (+ 9) % Row 3 \SetRowColor{white} The number of input data extracted by cin and \textgreater{}\textgreater{} depends on the number of variables appearing in the cin statement. & T \tn % Row Count 22 (+ 6) % Row 4 \SetRowColor{LightBackground} The extraction operator \textgreater{}\textgreater{} skips only all leading blanks when searching for the next data in the input stream. & F \tn % Row Count 28 (+ 6) % Row 5 \SetRowColor{white} When reading data into a char variable, after skipping any leading whitespace characters, the extraction operator \textgreater{}\textgreater{} finds and stores only the next character; reading stops after a single character. & T \tn % Row Count 38 (+ 10) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 3 (cont)}} \tn % Row 6 \SetRowColor{LightBackground} Entering a char value into an int variable causes serious errors, called input failure. & T \tn % Row Count 5 (+ 5) % Row 7 \SetRowColor{white} If input failure occurs in a C++ program, the program terminates immediately and displays an error message. & F \tn % Row Count 11 (+ 6) % Row 8 \SetRowColor{LightBackground} In an output statement, each occurrence of endl advances the cursor to the end of the current line on an output device. & F \tn % Row Count 17 (+ 6) % Row 9 \SetRowColor{white} You can use the function getline to read a string containing blanks & T \tn % Row Count 21 (+ 4) % Row 10 \SetRowColor{LightBackground} Suppose that x is an int variable and y is a double variable and the input is: 10 20.7 Choose the values after the following statement executes: cin \textgreater{}\textgreater{} x \textgreater{}\textgreater{} y;. & x = 10, y = 20.7 \tn % Row Count 30 (+ 9) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 3 (cont)}} \tn % Row 11 \SetRowColor{LightBackground} Suppose that x and y are int variables. Which of the following is a valid input statement? & cin \textgreater{}\textgreater{} x \textgreater{}\textgreater{} y; \tn % Row Count 5 (+ 5) % Row 12 \SetRowColor{white} 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 \textgreater{}\textgreater{} x \textgreater{}\textgreater{} ch \textgreater{}\textgreater{} y; & x = 15, ch = 'A', y = 73.2 \tn % Row Count 15 (+ 10) % Row 13 \SetRowColor{LightBackground} Suppose that x is an int variable, ch is a char variable, and the input is: 276. & B ch = '2', x = 76 \tn % Row Count 20 (+ 5) % Row 14 \SetRowColor{white} Suppose that alpha is an int variable and ch is a char variable and the input is: 17A What are the values after the following statements execute? cin » alpha; cin » ch; & alpha = 17, ch = 'A' \tn % Row Count 29 (+ 9) % Row 15 \SetRowColor{LightBackground} Suppose that x is an int variable, y is a double variable, z is an int variable, and the input is: 15 76.3 14 Choose the values after the following statement executes: cin \textgreater{}\textgreater{} x \textgreater{}\textgreater{} y \textgreater{}\textgreater{} z; & x = 15, Y = 76 . 3 , z = 14 \tn % Row Count 39 (+ 10) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 3 (cont)}} \tn % Row 16 \SetRowColor{LightBackground} Suppose that ch1, ch2, and ch3 are variables of the type char and the input is: A B C Choose the value of ch3 after the following statement executes: cin \textgreater{}\textgreater{} ch1 \textgreater{}\textgreater{} ch2 \textgreater{}\textgreater{} ch3; & 'C' \tn % Row Count 9 (+ 9) % Row 17 \SetRowColor{white} Suppose that x and y are int variables, z is a double variable, and the input is: 28 32.6 12 & x = 28, Y = 32, z = 0.6 \tn % Row Count 14 (+ 5) % Row 18 \SetRowColor{LightBackground} Suppose that x and y are int variables, ch is a char variable, and the input is: 4 2 A 12 Choose the values of x, y, and ch after the following statement executes: cin \textgreater{}\textgreater{} x \textgreater{}\textgreater{} ch \textgreater{}\textgreater{} y; & This statement results in input failure \tn % Row Count 24 (+ 10) % Row 19 \SetRowColor{white} Suppose that ch1 and ch2 are char variables, alpha is an int variable, and the input is: A 18 What are the values after the following statement executes? cin.get(ch1); cin.get(ch2); cin \textgreater{}\textgreater{} alpha; & ch1 = 'A', ch2 = , " alpha = 18 \tn % Row Count 34 (+ 10) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 3 (cont)}} \tn % Row 20 \SetRowColor{LightBackground} Suppose that ch1, ch2, and ch3 are variables of the type char and the input is: A B C What is the value of ch3 after the following statements execute? cin.get(ch1); cin.get(ch2); cin.get(ch3); & 'B' \tn % Row Count 10 (+ 10) % Row 21 \SetRowColor{white} When you want to process only partial data, you can use the stream function \_\_\_\_ to discard a portion of the inp & ignore \tn % Row Count 16 (+ 6) % Row 22 \SetRowColor{LightBackground} 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 \textgreater{}\textgreater{} alpha; cin.ignore(100, '\textbackslash{}n'); cin \textgreater{}\textgreater{} beta; cin.ignore(100,'\textbackslash{}n'); cin \textgreater{}\textgreater{} gamma; & 300 \tn % Row Count 30 (+ 14) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 3 (cont)}} \tn % Row 23 \SetRowColor{LightBackground} Suppose that ch1 and ch2 are char variables and the input is: WXYZ What is the value of ch2 after the following statements execute? cin.get(ch1); cin.putback(ch1); cin \textgreater{}\textgreater{} ch2; & W \tn % Row Count 9 (+ 9) % Row 24 \SetRowColor{white} Suppose that ch1 and ch2 are char variables and the input is: WXYZ What is the value of ch2 after the following statements execute? cin \textgreater{}\textgreater{} ch1; ch2 = cin.peek(); cin \textgreater{}\textgreater{} ch2; & X \tn % Row Count 18 (+ 9) % Row 25 \SetRowColor{LightBackground} In C++, the dot is an operator called the \_\_\_\_ operator. & member access \tn % Row Count 21 (+ 3) % Row 26 \SetRowColor{white} Suppose that x = 25.67, y = 356.876, and z = 7623.9674. What is the output of the following statements? cout \textless{}\textless{} fixed \textless{}\textless{} showpoint; cout \textless{}\textless{} setprecision(2); cout \textless{}\textless{} x \textless{}\textless{} ' ' \textless{}\textless{} y \textless{}\textless{} ' ' \textless{}\textless{} z \textless{}\textless{} endl; & 25.67 356.88 7623.97 \tn % Row Count 31 (+ 10) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 3 (cont)}} \tn % Row 27 \SetRowColor{LightBackground} x = 55.68, y = 476.859, and z = 23.8216. statements? cout \textless{}\textless{} fixed \textless{}\textless{} showpoint; cout \textless{}\textless{} setprecision(3); cout \textless{}\textless{} x \textless{}\textless{} ' ' \textless{}\textless{} y \textless{}\textless{} ' ' \textless{}\textless{} setprecision(2) \textless{}\textless{} z \textless{}\textless{} endl; & 55.680 476.860 23.82 \tn % Row Count 9 (+ 9) % Row 28 \SetRowColor{white} Suppose that x = 1565.683, y = 85.78, and z = 123.982. What is the output of the following statements? cout \textless{}\textless{} fixed \textless{}\textless{} showpoint; cout \textless{}\textless{} setprecision(3) \textless{}\textless{} x \textless{}\textless{} ' '; cout \textless{}\textless{} setprecision(4) \textless{}\textless{} y \textless{}\textless{} ' ' \textless{}\textless{} setprecision(2) \textless{}\textless{} z \textless{}\textless{} endl; & 1565.683 85.7800 123.98 \tn % Row Count 22 (+ 13) % Row 29 \SetRowColor{LightBackground} What is the output of the following statements? cout \textless{}\textless{} setfill('*'); cout \textless{}\textless{} \seqsplit{"12345678901234567890"} \textless{}\textless{} endl cout \textless{}\textless{} setw(5) \textless{}\textless{} "18" \textless{}\textless{} setw(7) \textless{}\textless{} "Happy" \textless{}\textless{} setw(8) \textless{}\textless{} "Sleepy" \textless{}\textless{} endl & \seqsplit{12345678901234567890} {\bf{{\emph{18}}Happy}}*Sleepy \tn % Row Count 32 (+ 10) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 3 (cont)}} \tn % Row 30 \SetRowColor{LightBackground} What is the output of the following statements? cout \textless{}\textless{} \seqsplit{"123456789012345678901234567890"} \textless{}\textless{} endl cout \textless{}\textless{} setfill('\#') \textless{}\textless{} setw(10) \textless{}\textless{} "Mickey" \textless{}\textless{} setfill(' ') \textless{}\textless{} setw(10) \textless{}\textless{} "Donald" \textless{}\textless{} setfill('*') \textless{}\textless{} setw(10) \textless{}\textless{} "Goofy" \textless{}\textless{} endl; & \seqsplit{123456789012345678901234567890} \#\#\#\#Mickey Donald{\bf{*}}Goofy \tn % Row Count 12 (+ 12) % Row 31 \SetRowColor{white} \_\_\_\_ is a parameterized stream manipulator. & setfill \tn % Row Count 15 (+ 3) % Row 32 \SetRowColor{LightBackground} Manipulators without parameters are part of the \_\_\_\_ header file. & iostream \tn % Row Count 19 (+ 4) % Row 33 \SetRowColor{white} Consider the following program segment. ifstream inFile; //Line 1 int x, y; //Line 2 ... //Line 3 inFile \textgreater{}\textgreater{} x \textgreater{}\textgreater{} 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? & \seqsplit{inFile.open("progdata.dat");} \tn % Row Count 33 (+ 14) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CH 3 (cont)}} \tn % Row 34 \SetRowColor{LightBackground} Suppose that outFile is an ofstream variable and output is to be stored in the file outputData.out. Which of the following statements opens the file outputData.out and associates outFile to the output file? & \seqsplit{outFile.open("outputData.out");} \tn % Row Count 11 (+ 11) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}