Hey. So I am pretty new to C++ programming only been doing it for a few weeks now. I have a midterm soon and my instructor posted a practice problem I have been trying to solve for a while now, but can't quite get it to do what I want it to. I am sure it is a simple error, but I need some help.
I was supposed to write a program that found that sum of rainfall over the course of three months to find out how much water tomato plants needed. It looked like this:
0 <= r < 2 1 Gallon
2 <= r < 7.5 0.5 Gallons
7.5 <= r Nothing needed!
So I wrote out my program and everything works fine, except my else if statements aren't really doing anything. No matter the sum that I put in, it always says "You need 1 gallon of water for your tomato plants!"