Find the total number of lines in a collection

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

Write two functions, so that we can find the total number of lines in a collection of text files.

a) The first one takes in the name of a text file as its only parameter, reads the file line by line, and returns the number of lines in the file.

b) The second function repeatedly prompts for a file name until the user signifies no more file names by pressing the Enter key with no characters typed in. For each file name, this function calls the one in (a) above and uses the returned value to accumulates a variable. Once there is no more file name entered, the function returns the accumulated value.

Invoke the second function, from function called main().

Reference no: EM13907605

Questions Cloud

Describe the characteristics of the product : Describe the characteristics of the product (GREEN Air-conds) sold by MUZTAFAH. How has consumer preference on this type of product changed over the years? Do you think MUZTAFAH understands its customers' changing needs
What is your experience with accounting fraud or abuse : What is your experience with accounting fraud or abuse? The experience can be professional with your career or personal with volunteer work, etc. If you cannot come with your own experience, you can use examples in the course materials or other re..
Schedule below for two separate investment centers a and b : 1. Fill in the blanks in the schedule below for two separate investment centers A and B. Round answers to the nearest wholepercent.
Should they torture the prisoner : For your thread, post an answer to the question, "Should they torture the prisoner?" employing the two points below.  Remember your initial thread must be a minimum of 350 words: From your understanding of Holmes' discussions,
Find the total number of lines in a collection : Write two functions, so that we can find the total number of lines in a collection of text files.
A range of possible positions on the issue : Choose an issue in professional ethics that pertains to a particular type of professional. Although the issue you choose may have arisen from a specific situation you will not be writing this as a case study as in Assignment
Interorganizational cybersecurity relationships : Interorganizational Cybersecurity Relationships
How might company communicate success of achieving objective : Do you consider these objectives compatible with one another and how might that company communicate the success of achieving these objectives to its stakeholders?
The notions of right and wrong : To this war of every man against every man, this also is consequent; that nothing can be unjust. The notions of right and wrong, justice and injustice have there no place. Where there is no common power, there is no law: where no law, no injustice.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create the program which converts fahrenheit to celsius

Create the following program which converts Fahrenheit to Celsius. Your program must have the following functions: Read integer Fahrenheit temperatures from the user.

  Struct complex

A complex number can be represented by two parts, real and image. A series complex data can be organized as a group of elements by linked list, which is shown as below: struct Complex

  Write a loop to total and average the contents of the array

Given the following code, write a loop to total and average the contents of the array.

  Simulate a simple microcontroller called the simpletron

Building a microcontroller simulator is a fantastic way to build your understanding of how computers work. Deitel & Deitel have an interesting problem called the Simpletron and the Simple Compiler.

  What is the output of the corrected loop

What is the output of the loop as it is written and correct the syntax of the loop so that the logic of the corrected loop corresponds to the formatting of the original loop. What is the output of the corrected loop?

  Prompts the user to enter the mass of a person

Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds. Output both the mass and the weight rounded to two decimal places

  Write a program to check the number

Write a program that asks the user to enter an integer from 1 to 50

  Dynamic array of a string that takes in names

Can you please show me an example of a C++ Class that has a dynamic array of a string that takes in names by user input??

  Advantages of compilers and interpreters

Discuss the advantages and disadvantages of compilers and interpreters

  Write a program that asks the user for non-negative integer

The factorial of n (written n!) is the product of the integers between 1 and n. Thus 4! = 1*2*3*4 = 24. By definition, 0! = 1.

  Write a cpp program for magic number

Ask the user to enter a "magic number," which is an integer between 0 and 9, inclusive. Then, ask a user to enter 10 integers between 0 and 9, inclusive. If a user enters an integer outside of that range, therefore invalid, notify the user of the ..

  Write a bouncing ball video game

The balls bounces within the screen where the two horizontal walls are fixed

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