Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a computer program as a 32-bit console application in C to read a properly formatted text file, to find the number of items and

image text in transcribed
Write a computer program as a 32-bit console application in C to read "a properly formatted text file", to find the number of items and the average of a series of numbers inside the file, and then display the results on the screen. The name your source program shall be p3.cand that of your corresponding executable program shall be p3.exe. Your program shall receive information from the user as a command-line argument. For example, a typical command line to start your program (from a command prompt) might be L: >p3 testfile.txt Your program shall NOT seek information from the user such as by a call to scan(). Your program shall NOT print information to the screen except as required herein. If your program is started without any command-line arguments it shall print the following line to the screen and terminate execution: EE 233 Spring 2017 P3, , . (Fill in your real Blazer id and name in place of and , and be sure to follow the output with a newline. Do not include the less-than and greater-than characters.) If your program is started with at least one command-line argument, it shall NOT print the line given above but shall proceed with normal execution. The first command-line argument (after the program name itself) will be the name of the text file for your program to read. The file will contain double numbers, separated from each other by a space, a newline, or a tab. If the file supplied as a command-line argument cannot be opened, your program shall write an error message to the screen and terminate execution. In a similar manner, your program shall properly handle all error conditions that might arise. Your program shall read the input text file and count the number of numbers, and find their average value. After your program has read and processed the entire file, it shall print the following line to the screen containing the various totals as defined above. contains , and their average value is . (Fill in the real File name in place of and and , should be filled in with the appropriate data values. Be sure to follow the output with a newline, and use 2 decimal places of accuracy for each numerical result

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

I wasnt sure how to talk about this situation. It was too personal.

Answered: 1 week ago

Question

What are the classifications of Bank?

Answered: 1 week ago

Question

=+ Why have these changes occurred?

Answered: 1 week ago

Question

=+90 percent of all oil refineries) into several smaller companies

Answered: 1 week ago