Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following statement will format the output of decimal numbers to three decimal places. cout < < setprecision(3); True False To force the output to

The following statement will format the output of decimal numbers to three decimal places.

cout << setprecision(3);

True
False

To force the output to show the decimal point and trailing zeros of a decimal number, use the ____________________ manipulator.

show-dot
showpoint
show-point
showdecimal
showdot

The setw manipulator cannot use a string as an argument.

True
False

The header file ____________________ needs to be included to use the setw function.

iomanip
io
none of the above
iostream
streammanip

Unlike the cin and cout variables of iostream, file stream variables must be declared by the programmer.

True
False

File I/O is a five-step process: Please match the step with the description.

Step 1

[ Choose ] Declare file stream variables Use the file stream variables with <<, >> or other I/O functions. Include the header file "fstream" in the program Associate the file stream variable with the I/O sources. Close the files Add spaces to the variable names

Step 2

[ Choose ] Declare file stream variables Use the file stream variables with <<, >> or other I/O functions. Include the header file "fstream" in the program Associate the file stream variable with the I/O sources. Close the files Add spaces to the variable names

Step 3

[ Choose ] Declare file stream variables Use the file stream variables with <<, >> or other I/O functions. Include the header file "fstream" in the program Associate the file stream variable with the I/O sources. Close the files Add spaces to the variable names

Step 4

[ Choose ] Declare file stream variables Use the file stream variables with <<, >> or other I/O functions. Include the header file "fstream" in the program Associate the file stream variable with the I/O sources. Close the files Add spaces to the variable names

Step 5

[ Choose ] Declare file stream variables Use the file stream variables with <<, >> or other I/O functions. Include the header file "fstream" in the program Associate the file stream variable with the I/O sources. Close the files Add spaces to the variable names

A file (or data file) is an area in secondary storage used to hold information.

True
False

File stream variables are predefined in the fstream header file and associated with input/output sources.

True
False

The stream member function ____________________ is used to open files.

fileopen
none of the above
openup
open
access

The following statement "outData.close();" closes the file stream outData.

True
False

Write a one line of C++ code using "cin" that gets first name, last name, age (as integer), height (as float), and date of birth (as string). You don't have to declare the variables, just write the one line of code.

Write a one line of C++ code that produces the following output. NOTE: you must use "Text Manipulators" from <iomanip> and not "hard coded" characters.

1 year----|....15 years 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books