Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help, please and thank you (Visiul studio C++) a.dat b.dat Requirements Write a program that accepts 1, or more, names of files that contain
Need help, please and thank you (Visiul studio C++)
a.dat
b.dat
Requirements Write a program that accepts 1, or more, names of files that contain rainfall measurements. Your progran ll include a function that will process the input data contained in each rile Each nle will contain some number ot raintall measurements, 1 per line, of the tom: amount units where amoint is a tloatng point value, greater than or equal to zero and ues is one or cm", 'mm", or 'In" for centimetres, milli'metres, and Inches respecively). Each measurement in a tile may have been measured in different units Your tuncton, called avgrain, will accept 2 argunents: nlename and avgunits (one or "cm", 'mm", or 'in"). It will read all the values contained in tilename, covert each measurement to the unts specined by avgunits, and return a floating point value that is calculated as the average of all the measurements read from filename Your progran should invoke tne avgrain tunction once tor each tlenane specitied in the input. output all averages in millimeters Sample Output Please enter the file names to read, separated by spaces: a. dat Aweragc rain from measurcments in files: a. dat 186.147 mm Please enter the file names to read,ated by spaces: a. dat b.dat Average rain from measurements in files: a. dat 186.147 mm b. dat 12.1333 m Sample input a dat and lb.datStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started