Compare and contrast the mode operators ios

Assignment Help C/C++ Programming
Reference no: EM13767668

Question 1. _____ are files to which data is written.

Output files

Input files

Active files

Sequential files

Question 2. When storing and retrieving data, a sequential access file is much like a _____.

floppy disk

book

hard disk

VCR tape

Question 3. Once you finish using a file, you should _____ it.

exit

append

close

output

Question 4. The header file that defines the classes for processing and manipulating files is called the _____.

<iostream>

<fstream>

<pstream>

<mstream>

Question 5. What do the following statements accomplish?

ofstream theFile;

theFile.open( myFile.txt , ios::out);

Opens myFile in read mode

Opens myFile in append mode

Creates an empty file named myFile

Opens a file in input mode to write to

Question 6. When a file is opened in output mode, the file pointer is positioned _____.

at the end of the file

at the beginning of the file

in the middle of the file

after the file header

Question 7. Which of the following functions should be used to determine if a file was successfully closed?

is_active

is_open

is_closed

is_ready

Question 8. What is the data hierarchy arranged from largest to smallest?

File, field, record, byte, bit

File record, field, bit, byte

File, record, field, byte, bit

Record, file, field, bit, byte

Question 9. To use an input file, the program must include _____.

fstream

instream

outstream

filestream

Question 10. Which of the following is not true about files?

C++ views each file as a sequential stream of bytes.

Files are opened by creating objects of stream classes.

Member functions of stream objects can be applied to file streams.

istream, ostream, and iostream are derived from ifstream, ofstream, and fstream, respectively.

Question 11. Compare and contrast the mode operators ios::in, ios::app, and ios::out. Provide a C++ code segment that illustrates the use of these mode operators.

Reference no: EM13767668

Questions Cloud

Attempts to model all of the uncertainties of the real world : Which method best attempts to model all of the uncertainties of the real world?
Forecast gross profit in the second year : Tversky and Co. have devised a new psychological test for investors' risk tolerance. They expect to sell 10,000 tests in the first year at $150 each. Cash costs associated with producing, administering and scoring the test are $50 per unit. In the..
What are some recent and contemporary examples of successes : What are some recent and contemporary examples of successes and failure in community engagement? (Ferguson, New York, other examples)
Create an amortization schedule for the first two months : You have borrowed $70,000 to buy a speed boat. You plan to make monthly payments over a 15-year period. The bank has offered you a 9% interest rate, compounded monthly. Create an amortization schedule for the first two months of the loan.
Compare and contrast the mode operators ios : Compare and contrast the mode operators ios::in, ios::app, and ios::out. Provide a C++ code segment that illustrates the use of these mode operators.
Variable cost per unit projection for a project : Les is concerned that his variable cost per unit projection for a project may not be reliable. Which type of analysis will help him determine the effect that an incorrect variable cost estimate will have on the final outcome of the project?
What was the semi-annual current yield : The City of Ames issued a new series of bonds on Jan 1, 2009. The bonds were sold at par ($1,000), have a 3.5% annual coupon rate and mature in 10 years, on Jan 1, 2019. Coupon interest payments are made semi-annually (on June 30 and December 31). Wh..
What remedies may tommy get : Jimmy, an art dealer and merchant, is running out of funds. Luckily, he owns a priceless Van Gogh painting. He writes his friend Tommy. Is there a breach of contract? If so, what remedies may Tommy get
In a decision tree-accept-reject decision is dependent : In a decision tree, the accept/reject decision is dependent upon:

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Monkey business, a local zoo

Monkey Business, a local zoo, wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3 7 array, where each row represents a di..

  Loops and if conditions

Write a program that requests a password

  Algorithm to be converted to c language

algorithm to be converted to c language

  The imperial system of measurements

The Imperial system of measurements uses feet and inches for length, where 1 foot is equal to 12 inches. Write a class named Imperial that will represent distance measurements in feet and inches. Your class should include the following.

  Write a program that reads in babynames

Write a program that reads in babynames.txt and produces two files - Separate the data for the boys and girls. You may enter any names

  Unlike c other programming languages have associative

unlike c other programming languages have associative arrays that allow array indices to be strings instead of just

  You are to add mean, standard deviation

You are to add mean, standard deviation, and insert in order functionality to your statistics list program. Insert in order means that you will add a function called find_index that will locate the place in the array that a new value should be ins..

  Write a program to open a file for reading

Write a program to open a file for reading that has twenty (20) rows and in each row there are three (3) columns.

  Write a program that asks the user to enter the names of 3

Write a program that asks the user to enter the names of three salesmen. The program should thenaccept the sales produced for salesman for each quarter of the year. Display the name, and the totalsales amount, of each salesman.

  Write a recursive and iterative versions of binary search

In C++ write a recursive and iterative versions of binary search and compare their run times using the array a[i]=i, i=0,..., n-1 and the given test method:

  Which respectively represent the name of the flower

Write a C++ class, Flower, that has three member variables of type string, int, and float, which respectively represent the name of the flower, its number of pedals, and price.

  Prompts the user to enter time in 12-hour notation

Write a program that prompts the user to enter time in 12-hour notation. The program then outputs the time in 24-hour notation. Your program must  contain  three  exception  classes

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd