Write a C program named as countD.c that takes input text file and a digit as...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C program named as countD.c that takes input text file and a digit as arguments, outputs how many times the digit appears in the file. If the text file does not exist, print out an error message to the terminal. For example, sample outputs could be like below $cat test.txt This is a list of courses. CSC 1010 - COMPUTERS & APPLICATIONS $. /countD test.txt 1 '1' appeared 2 times $. /countD NotExist.txt 1 Error: file not exist. Write a C program named as countD.c that takes input text file and a digit as arguments, outputs how many times the digit appears in the file. If the text file does not exist, print out an error message to the terminal. For example, sample outputs could be like below $cat test.txt This is a list of courses. CSC 1010 - COMPUTERS & APPLICATIONS $. /countD test.txt 1 '1' appeared 2 times $. /countD NotExist.txt 1 Error: file not exist.
Expert Answer:
Answer rating: 100% (QA)
Answer Heres a C program named countDc that takes an input text file and a digit as arguments an... View the full answer
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date:
Students also viewed these programming questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
How many bracketings of length 2n will there now be? 1 [TURN OVER CST.93.2.2 2 Two teams A and B play a match in which the winner is the first team to win n games. If A needs i games to win and B...
-
Tell whether the given side lengths form a right triangle. 8, 10, and 14
-
Two species of foxes are shown below. One is a kit fox in the Mojave Desert, California. The other is an Arctic fox in Manitoba, Canada. Which is which? How can you tell? Describe at least two traits...
-
1. What is the business reason for China Noah's potential currency exposure? Does the company really need to subject itself to substantial exchange rate risk? Is the risk "material" to China Noah? Do...
-
Go to the St. Louis Federal Reserve FRED database, and find data on real GDP (GDPC1), potential GDP (GDPPOT), and the unemployment rate (UNRATE) from 1960 to the most recent period. For the...
-
Clarence Weatherspoon, a super salesman contemplating retirement on his fifty-fifth birthday, decides to create a fund on an 8% basis that will enable him to withdraw $20,000 per year on June 30,...
-
Matt has worked as an electrician for 24 years with the same company and is about to retire. He has a final-earnings pension plan. His pension benefit will be 1% per year based on the average of his...
-
Randy Smith was very proud of his new position as inventory control manager for theJohnson Trinket Company. His primary responsibility had been fairly clearly defined: Maintain an inventory level in...
-
one of my Harvard Business School executive education classes told a story about a family trip to Walt Disney World in Orlando, Florida. She lost her purse in the park on the very first day: tickets,...
-
To what extent might the fear of making mistakes prevent you from being as creative as you could be in facilitating a group? In leading a group characterized by many forms of diversity, what would be...
-
INTRODUCTION Some people say that young people should look up to celebrities as role models. Do you agree? INSTRUCTION Write a 140-170-word essay expressing your opinion on the statement, and include...
-
1. To what extent was the result of the Self-Assessment a surprise to you or not? Are you a better listener than you realized? Are there certain practices or characteristics that you possess that...
-
Various financial data for the past two years for XYZ Industries is below. Calculate the Multifactor productivity ratio and enter the % change from last year to this year. Last Year This Year %...
-
Prepare a memo summarizing your audit plans that answers the following questions regarding Starblocks' Urbana, IL roasted coffee bean inventory: (1) Under what conditions, if any, can your audit team...
-
Consider the two computers A and B with the clock cycle times 100 ps and 150 ps respectively for some program. The number of cycles per instruction (CPI) for A and B are 2.0 and 1.0 respectively for...
-
Find the area of the surface generated by revolving the para- metric curve x = cos 1, y = sin? 1 (0 < I sa/2) about the y-axis.
-
Describe structured systems analysis.
-
Finco Merchandising specializes in purchasing bankrupt firms and disposing of their assets by direct mail. It maintains about 30 sales offices around the United States. Each of these sales offices...
-
Launa Neta is a CPA, Certified Fraud Examiner, and the internal auditor for Remco Produce Distribution Company. A confidential tip from an employee in the central warehouse who serves the U. S. east...
-
Cress Trust owns houses in Marion County, for whom Rainbow Realty Group, Inc., sells, rents, and manages. The same person serves as Rainbows president and Cresss corporate trustee. Cress offers four...
-
Genevieve and William Timmons began their tenancy of a ground-floor apartment at Cobblestone Square in September 2011. Kingsley-Johnston, Inc., is a property management company responsible for...
-
Linda Miller rented 35 acres of pastureland in Wabaunsee County, Kansas, from William Burnett for $1,000 per year. Miller and her husband used the land to grow and harvest brome grass for their...
Study smarter with the SolutionInn App