Months with 30 days have 720 hours, and months with 31 days have 744 hours. Febr
ID: 3529361 • Letter: M
Question
Months with 30 days have 720 hours, and months with 31 days have 744 hours. February, wih 28 days, has 672 hours. Enhance the input validation ( Input Validation: Be sure the user only select pckage A, B, C. Also, the number of hours used in a month cannot exceed 744. ) of the Internet Service Provider program by asking the user for the month (by name), and validating that the number of hours entered is not more than the maximum for the entire month. (This is what I have so far) //Internet Service Provider 2 #include using namespace std; int main() { int hours; char pack; double totA,totB,totC; cout<<"Make a Selection "; cout<<"(A)Package A "; cout<<"(B)Package B "; cout<<"(C)Package C "; cout<<"Enter your selection: "; cin>>pack; cout<<"Enter hours: "; cin>>hours; if(hours>744) cout<<"That's more hours then in a month!! "; else { if(hours<10) totA=9.95; else totA=9.95+(hours-10)*2; if(hours<20) totB=14.95; else totB=14.95+(hours-20); totC=19.95; } switch (pack) { case 'A':cout<<"Monthly Bill: $"<<totA<<endl; cout<<"if had chosen package B would have saved $"<<totA-totB<<endl; cout<<"if had chosen package C would have saved $"<<totA-totC<<endl; break; case 'B':cout<<"Monthly Bill: $"<<totB<<endl; cout<<"if had chosen package C would have saved $"<<totB-totC<<endl; break; case 'C':cout<<"Monthly Bill: $"<<totC<<endl; break; } system("pause"); return 0; }Explanation / Answer
http://bytes.com/topic/c/answers/167167-string-mutiple-characters
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.