Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Greater - Than Counter Write a program in question _ 5 ( ) that reads a user - specified file of floating - point numbers,

Greater-Than Counter
Write a program in question_5() that reads a user-specified file of floating-point numbers, and counts how many of
those numbers are larger than a user-specified threshold.
You can see from the example output below that the program determines the number of numbers/lines from reading
the file.
Your program should work for any file of numbers (one per line) of any size.
The example below has 10 lines, but yours might have 365 or 2 or...
We ALWAYS write algorithms and code to solve general problems (within reason), so you rarely hard-code something
like the length/size of a file.
Example file:
Copy the numbers below into a new file called recentrain.txt ,
or download recentrain.txt here.
12.4
10.0
10.1
0
8.4
13.9
19.1
141.0
33.5
1.2
Example output:
Filename: recentrain.txt
Threshold: 13.9
Processing...
3 out of 10(30.0%) values in recentrain.txt are greater than 13.9.
image text in transcribed

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

Step: 3

blur-text-image

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

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

What were your most important educational experiences?

Answered: 1 week ago

Question

Which personal relationships influenced you the most?

Answered: 1 week ago