How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask LogicPro Your Own Question
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 12875
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
29751445
Type Your Homework Question Here...
LogicPro is online now
A new question is answered every 9 seconds

Try/Catch blocks Modify the program on the following page

This answer was rated:

Try/Catch blocks

Modify the program on the following page to include these exceptions:
• If the number of hours is 0, display a message indicating that the number of hours must be greater than 0.
• If the number of hours is greater than 20, display a message that the number of hours must be less than 20.
• If the responses to the instate/out of state or the oncampus/off campus questions is other than “Y” or “N”, display a message indicating that the response must be either “Y” or “N”.


#include // Controls input and output in a C++ program
using namespace std; // "Palette" upon which program is written

#define IN_STATE_TUITION 102.88
#define OUT_OF_STATE_TUITION 399.65
#define ROOM_AND_BOARD 9999.99

int main()

{

int hoursTaking;
double tuitionDue;
string floridaResident, campusLife;

cout <> hoursTaking;
cout <> floridaResident;

// Is the student a Florida resident?
if (floridaResident=="Y")
{
tuitionDue=IN_STATE_TUITION*hoursTaking;
}
else
{
tuitionDue=OUT_OF_STATE_TUITION*hoursTaking;
}
cout <> campusLife;

//Add room/board cost if the student is staying on campus.

if (campusLife=="Y")
{
tuitionDue=tuitionDue+ROOM_AND_BOARD;
}
cout << "\n" " Your Total Cost for the Term is: $" <<tuitionDue<< "\n \n" ;

return 0;
}
Hi,
Welcome back. Hope you are doing well.

If you have any file(s), Zip all files, upload the zipped file to http://wikisend.com and post download link here.
What is the deadline?
Customer: replied 3 years ago.

I know I said Friday for the deadline... If you can get it to me in the next hour and a half there will be a good tip for you. I would really appreciate it.

I didn't get your last reply.
I will try my best to provide you answer ASAP.
If you have any file(s), Zip all files, upload the zipped file to http://wikisend.com and post download link here
Customer: replied 3 years ago.

Yeah, I just noticed that... Wow. The statement I gave was not on there... hmm.


 


Well It is only through try/catch methods.

ok, check back in 1 hour for the answer.
Customer: replied 3 years ago.

OK. thanks..


 

Welcome
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
LogicPro and 2 other Homework Specialists are ready to help you
Customer: replied 3 years ago.

Thanks! I really appreciate it!

Welcome:)

Related Homework Questions