having issues with my program this is where I am messing up as int HotelRoom::Ch
ID: 3546553 • Letter: H
Question
having issues with my program this is where I am messing up as
int HotelRoom::Change_Status(int roomStatus)
{
occupancy_status = roomStatus;
[MST1]Compiler error in this method. This function is defined as returning an integer value, but you do not return one. You have to return an integer value.
Fix this error, make sure your program compiles, test it, and resubmit for grading.
having issues with my program this is where I am messing up as int HotelRoom::Change_Status(int roomStatus) { occupancy_status = roomStatus; }[MST1] [MST1]Compiler error in this method. This function is defined as returning an integer value, but you do not return one. You have to return an integer value. Fix this error, make sure your program compiles, test it, and resubmit for grading.Explanation / Answer
// below is one of solution
// either make it to return occupancy_status or
// make function void. in both .h and .cpp files.
int HotelRoom::Change_Status(int roomStatus)
{
occupancy_status = roomStatus;
return occupancy_status;
}
//another solution is
void HotelRoom::Change_Status(int roomStatus)
{
occupancy_status = roomStatus;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.