Write a program in which you create a text class

Assignment Help Computer Engineering
Reference no: EM132209662

Question :

Write a program in which you create a Text class that contains a string object to hold the text of a file.

Give it two constructors: a default constructor, and a constructor that takes a string argument that is the name of the file to open.

When the second constructor is used, open the file and read the contents of the file into the string member object.

Add a member function contents() to return the string so that you can display it. In main(), open a file using Text, and display the contents.

IN C++

Reference no: EM132209662

Questions Cloud

Write a program that converts centimeters to inches : Write a program that converts centimeters to inches. Your program should prompt the user to enter a height in centimeters, convert it to inches.
Display all integers between low and high that are the sum : Write a program that displays all integers between low and high that are the sum of the cube of their digits.
Determine the address of memory locations allocated : Declare two short int variables, two int variables, and long int variable and then output the address of each variable.
Write a program that creates a pointer to a dynamic array : Write a program that creates a pointer to a dynamic array of integers of size 10. The program will load the array with values from 1 to 10.
Write a program in which you create a text class : Write a program in which you create a Text class that contains a string object to hold the text of a file.
Fill the first vector object with the loop counter value : Write a program that creates three vector objects. Fill the first two objects with 25 floating-point numbers using a for loop.
Write a program that draws a pyramid of blocks of any given : Write a program that draws a pyramid of blocks of any given height in Java. *USING RECURSION*
Write a program that enables two users to chat using javafx : Write a program that enables two users to chat using JavaFX, threads, sockets. Implement one user as the server and the other as the client.
Write a program that dynamically creates pieces of storage : Write a program that dynamically creates pieces of storage of the following types using new: int, long, an array of 100 chars, and an array of 100 floats.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Transmitting the rtp stream

Consider that a sender transmits a silence suppressed the RTP stream of G.711 audio to the receiver (G.711 refers to the name of standard for 64Kbps PCM we discussed in class).

  Write a new function copy up half that copies bottom half

The function copy Half copied the top half of picture into the bottom half. Write a new function copy Up Half that copies the bottom half of picture into top.

  Questionselect versionfrom stove stoverepairwhere distinct

questionselect versionfrom stove stoverepairwhere distinct stove.type maytag and stove.serialnumber

  Design a data structure which supports two operations

Design a data structure which supports two operations 1. Insert(S, x) inserts x into S. 2. Remove-Duplicates(S) removes from S all duplicated values.

  Implement constraint satisfaction problem - Sudoku Puzzles

CS 550 - Artificial Intelligence Assignment contains a partially implemented constraint satisfaction problem class for solving Sudoku puzzles

  Discuss the pros and cons of the two approaches

Discuss the pros and cons of the two approaches. The issues you should consider, among other& are efficiency (disk space and access time).

  Describe categories of project success measures

List and describe the four different categories of project success measures. During which stage of a project are most risks typically uncovered?

  How many btus of heat are delivered to a house given

Write a program that calculates how many BTUs of heat are delivered to a house given the number of gallons of oil burned and the efficiency of the house's oil.

  Design a subroutine to display the ascii character

A memory-mapped VDT displays the 1024 8-bit characters starting at $00 F000 on a CRT terminal as 16 lines of 64 characters.

  Questionboolean calculator two continue solution program

questionboolean calculator two continue solution program from the preceding exercise by implementing following

  Write a single statement to display the number of digits

Write the statement to instantiate a package to do input and output with US_Gallons. Write a single statement to display the number of digits of precision used.

  Write a 1150- to 1350-word paper in which you discuss and

write a 1150- to 1350-word paper in which you discuss and explain the interrelationship of prohibition and the rise

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