Write a C++ program that will read a file of student names. Your program should find...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C++ program that will read a file of student names. Your program should find the file in the current directory of your project. The file name should be students.txt. Your program should open the file, read all the names and determine the following: the total count of names in the file - how many names are the same length SAMPLE OUTPUT: The file contains 25 names 5 names were 3 characters long 8 names were 4 characters long 3 names were 5 characters long etc. Jackie Sam Bill Tom Mary Paul Zev Barb John Sharon Dana Dominic Steven Padro Katey Kathy Darius Angela Mimi Jesse Kenny Lynn Hector Brittany Jenn Joe Chloe Geena Sylvia Dean Write a C++ program that will read a file of student names. Your program should find the file in the current directory of your project. The file name should be students.txt. Your program should open the file, read all the names and determine the following: the total count of names in the file - how many names are the same length SAMPLE OUTPUT: The file contains 25 names 5 names were 3 characters long 8 names were 4 characters long 3 names were 5 characters long etc. Jackie Sam Bill Tom Mary Paul Zev Barb John Sharon Dana Dominic Steven Padro Katey Kathy Darius Angela Mimi Jesse Kenny Lynn Hector Brittany Jenn Joe Chloe Geena Sylvia Dean
Expert Answer:
Answer rating: 100% (QA)
Heres a C program that reads a file named studentstxt in the current directory counts the ... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Johan believes the parking lot attendant wants him to pull into the next spot because the attendant is waving at him and has a smile on his face. Which stage of the perception process is Johan using?
-
You are to write a C program that will read from a file, one or more sets of x,y coordinates. Each set of coordinates is part of a Cartesian system. A Cartesian coordinate system is a system that...
-
Please do the following Matlab problem, 1.Write a for loop ranging from 3 to 5. In the loop, print the value of the loop index to the screen using fprintf in the following format: Value is n where n...
-
5 Question 42 (2.5 points) Consider a put option that gives the long position the right to sell the underlying asset for $12.34 in 5.67 years. The continuously compounded risk free rate of interest...
-
Consider a commodity with constant volatility and an expected growth rate that is a function solely of time. Show that, in the traditional risk-neutral world, where S T is the value of the commodity...
-
Why do big companies still fail in their use of information technology? What should they be doing differently?
-
An investor comes to you and tells you that a company wants to invest in a new turbine design with the following performance characteristics: \(112 \mathrm{~m}\) rotor diameter \(13 \mathrm{~m} /...
-
The following transactions are for Solarte Company. 1. On December 3, Solarte Company sold $500,000 of merchandise to Rooney Co., terms 1/10, n/30. The cost of the merchandise sold was $330,000. 2....
-
How do media exposure modes affect our ability to engage our personal locus, thus meeting our highest goals and motivations and fulfilling our deepest needs? Which median exposure mode is most...
-
Vincent Cardoza is the owner and manager of a machine shop that does custom order work. This Wednesday afternoon, he has received calls from two customers who would like to place rush orders. One is...
-
Gordy Campbell is a Director on the Board of Greasy Palms Inc., a BC company. The company is currently expanding its operations, due to a major contract it has received from the Provincial...
-
An investor enters into a short forward contract to sell 100,000 British pounds for US dollars at an exchange rate of 1.4000 US dollars per pound. How much does the investor gain or lose if the...
-
A US Treasury bond pays a \(7 \%\) coupon on January 7 and July 7 . How much interest accrues per \(\$ 100\) of principal to the bondholder between July 7, 2011, and August 9, 2011? How would your...
-
How do international privacy laws differ from U.S. privacy laws? What is the GDPR? Do you feel it makes users more secure or less? Why? Investigate press reports online regarding the success,...
-
What do you think of Uber's market experimentations, as well as its novel but unsuccessful efforts like its troubled leasing program? Is this "spaghetti management" (meaning throw it at the wall and...
-
Privacy laws are in a near constant state of flux. Conduct research to identify the current state of privacy law. Has major legislation recently been proposed or approved? What are the implications...
-
Three partners A, B and C invested their amounts in ratio of 3 : 5 : 6. At the end of four months, A invests some amount such that, his total investment will equal to C's initial investment and C...
-
Compare and contrast licensing and subcontracting.
-
We would like to assess a service charge for cashing a check. The service charge depends on the amount of the check. If the check amount is less than $10, we will charge $1. If the amount is greater...
-
Create an abstract class DiscountPolicy. It should have a single abstract method computeDiscount that will return the discount for the purchase of a given number of a single item. The method has two...
-
Revise the class OneWayNoRepeatsList, as given in Listing 7.9, so that it allocates an extra element in the array entry and ignores entry[0], as suggested earlier near the end of the section entitled...
-
How does the WTO differ from the GATT?
-
Describe the five major organizations governing the EU.
-
How do the various forms of economic integration differ?
Study smarter with the SolutionInn App