Question
Can someone help me with my C++ code? It's suppose to read from a file called rainfall_data.txt and display the average number of days without
Can someone help me with my C++ code? It's suppose to read from a file called "rainfall_data.txt" and display the average number of days without receiving rainfall greater than or equal to 0.10". Everything works except for one thing. Some of the data in the file looks like this:
0.13 0.00 T 0.00 0.00 0.00 T 1.61 0.00 0.93 0.00 0.23
And when I run it I get an error because of the "T". Is there a way to make the T value equal to 0.01 so I dont have to manually change it by hand? Thank you.
#include
while(inFileStr >> value) { myArray[i] = value; i++; }
int l=0; for(int k=0;k
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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