Create ifstream and ofstream objects called infile n outfile

Assignment Help Programming Languages
Reference no: EM13936382

I need help with this program. I need to create an array of 26 components to do the letter count for the 26 letters in the alphabet and a variable for the line count. (You may wish to call these variables letterCount and lineCount respectively.) Hint: Use the plan of declaring variables, opening input and output files, initializing the variables, reading and writing the character for each character in a line, incrementing the letter count, incrementing the line count, outputting line and letter counts and, finally, closing the input and output files. (You may wish to call the program outputting line and letter counts writeTotal.) Create an ASCII (or text) file that contains text that will be used as input to your program. Call this file textinput. Have the output stored in a file called textouput.

Create ifstream and ofstream objects called "infile" and "outfile" respectively. Include 4 functions for initializing, copying text, counting, and writing the results to a file, respectively.

•Initialize the initial array with 0's.

•Have the file copying text specifically be able to read a line and output that line. (You may wish to call this file copyText.)

•Whenever a nonblank character is found, it calls the function that does the counting, characterCount, to update the letter count. (Do not count blank, tab, or end-of-line characters as part of the letter count.)

•Have the characterCount function convert the letter to uppercase, find the index of the array corresponding to this letter and, if the index is valid, increment appropriate count.

•Have the main program do the following:

Declare variables. Open the input and output files.If the input file does not exist, exit the program.Open the output file. If the output file cannot open, exit the program. Initialize variables counting the lines and letters. Read the first character. Use while (not end of input file).Process the next line using the function that reads a line and outputs the line copyText. Increment the line count. (Increment the variable lineCount.) Read the next character. Output the line count and letter counts.
Use writeTotal. Close files.

Reference no: EM13936382

Questions Cloud

What would the composite standard deviation be for the risks : Given the following standard deviations of risk type 1 and 2 of $200,000 and $300,000 along with their associated correlations shown below, what would the composite standard deviation be for these risks?
Explain conflict between legislative and executive branches : Consider how that conflict has been resolved to allow the president to negotiate free trade agreements. Explain the conflict between the legislative and executive branches in negotiating free trade agreements
Discuss company marketing-business communication strategy : application to of best practice model to discuss current company marketing and business communication strategy -summary
Calculates and displays the body mass index : Write a Java application that calculates and displays the body mass index (BMI) for N people. N should be declared as a constant and should be equal to the largest digit of your student id number (e.g. if your student id is s0705544 then N should ..
Create ifstream and ofstream objects called infile n outfile : Create ifstream and ofstream objects called "infile" and "outfile" respectively. Include 4 functions for initializing, copying text, counting, and writing the results to a file, respectively.
How might you get a handle on customer reaction to strategy : How might you get a handle on customer reaction to the strategy? What steps should you take before considering whether to roll out this strategy?
Names and numbers of london-based suppliers : Give the relational algebra expression for the following English queries. 1. Get the supplier# who supply all the blue parts
Create a digital marketing plan for an existent company : Students will create a digital marketing plan for either an existent company of their choice, or for a fictitious company. The focus of the report should be placed on a particular product or an event.
Defiine an unsorted type adt : Postconditions: list1 contains all the items of list whose keys are less than or equal to item's key; list2 contains all the items of list whose keys are greater than item's key.

Reviews

Write a Review

Programming Languages Questions & Answers

  This laboratory gives practice in the creation and use of

this laboratory provides practice in the creation and use of basic and advanced sql queries involving more than one

  Compute and print annual salary of employee

Identify input, process and output to solves each problem. Compute and print the annual salary of employee. suppose the employee receive 6% increase in pay.

  Reservations system to be horizontal or vertical application

Top Sail Realty Situation: Top Sail Realty is one of the largest time-sharing and rental brokers for vacation cottages. Do you consider the reservations system to be a horizontal or a vertical application? Give reasons for your answer.

  Using a software program to create story books

submit a unit plan spanning Two to Four weeks. See this example of a unit plan, (or search the web for a unit plan example that best suits matches your needs). Technology should be integrated for assessment, instruction, and student engagement..

  Create a function that takes a one dimentional array

Create a function that takes a one dimentional array us a argument the function should return only these members from the array which are divisible by 4.

  Javascript function to verify fields if cookie is added

JavaScript function has verified that all the required fields have been filled, cookie is added to user's computer. If same user tries to fill out form second time.

  Program read data from input file and select specified items

Program should be able to read data from input file and select the specified items. Write data for school-age males to file male.out and data for school-age females to female.out.

  Write a program that draws a picture of a house

Write a program that draws a picture of a house. It could be as simple as the accompanying figure, or if you like, make it more elaborate (3-D, skyscraper, marble columns in the entryway, whatever).

  Implementing an erp successfully

Don't you think that without these types of governance groups they would be many conflicts between the different business units?

  Function to convert a decimal input into roman numerals

Write a function that converts a decimal input into Roman Numerals. Your function will take in a number and output a string.

  Html5 assignment i need an assignment for html5 containing

i need an assignment for html5 containing 2 parts1 3 pages html5 website2 report more important than the website

  Write program to accept five input values in array

Write a program that accepts five input values and stores them into an array. The program should display those five numbers in reverse order.

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