Question: Please answer in python 3 Phil just got a new puppy. Because he lives in an apartment, his neighbors will complain if the puppy barks

Please answer in python 3

 Please answer in python 3 Phil just got a new puppy.Because he lives in an apartment, his neighbors will complain if thepuppy barks at 8 p.m. (20:00) or later and before 7 a.m.

Phil just got a new puppy. Because he lives in an apartment, his neighbors will complain if the puppy barks at 8 p.m. (20:00) or later and before 7 a.m. (7:00). On any given day, determine whether or not Phil's new puppy will cause the neighbors to complain. Function Description: Complete the function neighborComplains in the editor below. The function should return true if the neighbors complain and false if they don't complain, based on the problem description above. The neighborComplains function has the following arguments: isBarking: a boolean variable indicating whether or not the puppy is barking hourOfDay: a whole number between 0 and 23 that indicates the hour of the day (in 24h time being evaluated. You should return true for when the neighbor will complain, and false when the neighbor will NOT complain. Examples: isBarking = true, hourOfDay = 22 These input arguments would result in a return value of true, given that the dog is indeed barking at 10 p.m. (22:00). isBarking = false, hourOfDay = 23 These input arguments would result in a return value of false, given that the time is 11 p.m. (23:00), #include /* * Complete the 'neighbor Complain' function below. * * The function is expected to return a BOOLEAN. * The function accepts following parameters: 1. BOOLEAN isBarking 2. INTEGER hourOfDay */ * * bool neighbor Complain(bool isBarking, int hourofDay) { } int main() { ofstream fout(getenv("OUTPUT_PATH")); string isBarking_temp; getline (cin, isBarking_temp); bool is Barking = stoi(ltrim(rtrim(isBarking_temp))) != 0; string hourofDay_temp; getline (cin, hourOfDay_temp); int hourOfDay = stoi(ltrim(rtrim(hourOfDay_temp))); bool result = neighbor Complain(isBarking, hourofday); bool result = neighbor Complain(isBarking, hourOfDay); fout (isspace))) ); return s; } string rtrim(const string &str) { string s(str); s.erase find_if(s.rbegin(), s.rend(), noti(ptr_funsint, int>(isspace))).base(), s.end() ); return s; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!