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

  What is the output

Suppose that x and y are int variables, z is a double variable, and ch is a char variable. Suppose the input statement is.

  Write a c++ program that creates and populate a tree

Write a C++ program that creates and populate a tree for an arithmetic expression. Then it should perform an in-order and a post-order traversal on the tree.

  Program in c to ask the user to input a set of characters

Write a program in C++ to ask the user to input a set of characters, one at a time separated by the carriage return (Enter). Each character, as well as, its corresponding ASCII value should be stored in a linked list node. This means that each nod..

  User that will be asked to input the time

Write a code for the following C++ problem. We will have a user that will be asked to input the time of a train traveling in terms of minutes and this minutes is a non-negative integer.

  If a class is derived protected

If a class is derived protected from a base class, explain how this affects the inheritance of all public, protected, and private members of the base class by the derived class.

  Write a c program that reads a data file of floating numbers

Write a program that reads a data file of floating numbers into an array and prints the array elements along with the number of items in the array

  Implemented a regular binary search tree

In Computer Science I, you implemented a regular binary search tree. Due to your busy schedule, you've decided that it would be best if you could simply reuse this code without any changes. You realize that your code would ONLY work for Arup's ass..

  Find out if damjibhai can win

Once a jewel type is removed from the necklace, all other instances of the same jewel type is treated as polished by the person who removed the jewel

  In psuedocode, design an application

In psuedocode, design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorithm to locate one of the values

  You are to write a basic bank application

You are to write a basic bank application, in C++, that allows the user of the application to manually create, modify, and delete bank accounts. Before you write the application you will need to create a class called Account.

  Use a loop in main to efficiently handle all three persons

Plan and finish writing the main program, and all the functions, including a constructor. Use a loop in main to efficiently handle all three persons' data.

  This program need to be writen in c in this program we need

this program need to be writen in c in this program we need to create program that uses functions and reference

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