![]() |
| ||
| Help me! C++ Hey guys! CAn u tell me if my program is right? First, I need to get a Pkg and validate; Second,get month and validate; Third, determinate max hours; *If FEB; Fourth, get year and validate(1990-2020) check for leap yr. Fifth, get hours and validate against maxhours; and calculate the bill ^^(month) I have 3 pkg PKG A = $12 month PKG B = $18 " " " PKG C = $25 " " " Thank you!! Thx #include <iostream> |
| ||
| Re: Help me! C++ It almost looks like you threw something out in the wind in the hopes that someone will fix it up for you. Clean up your code with indentation to begin with so it's a little more legible. Then run it to see if you get the results you expect. Right off hand without spending to much time it appears the only time leaps years will be evaluated is when the month is less than 1 or greater than 12. Please enclose your next post in code tags. if(yr>=1990 && month<=2020)You see the problem here. |
| ||
| Re: Help me! C++
Your if else statements look rather odd at first glance? Maybe? |
| All times are GMT -4. The time now is 1:57 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC