Question
solve no chegg 4 Unary Operator overloads are not working could you please fix them so that i can get the same output as the
solve
no chegg
4 Unary Operator overloads are not working could you please fix them so that i can get the same output as the correct output file that is in https://gofile.io/d/1hOKMW. the code is in their as well. Could you explain where i went wrong. Bus operator--();//not working Bus operator++();//not working Bus operator--(int);//not working Bus operator++(int);//not working Output I get: In line number 73 of your output: The output should be: b1: 9 ^ But your output is: b1: 10 ^ Unmatched character details: The character in column 5 is supposed to be: [9] ASCII code(57) but you printed [1] ASCII code(49) correct output: Operator <<, Operator >>, display and read test __________________________________ | [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]|_\_ | Seneca College ) `---OO-------------------------O---' Total Fare Price: 0.00 ---------- Out of service! ---------- Out of service! ---------- Out of service! ---------- _________________________________________________ | [2][2][2][2][2][2][2][2][2][2][1][ ][ ][ ][ ]|_\_ | Seneca College ) `---OO----------------------------------------O---' Total Fare Price: 2632.14 ---------- Enter the following valid values: 22,11 >22,11 _____________________________________ | [2][2][2][2][2][1][ ][ ][ ][ ][ ]|_\_ | Seneca College ) `---OO----------------------------O---' Total Fare Price: 1378.74 ---------- Enter the following valid values: 24,0 >24,0 ________________________________________ | [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]|_\_ | Seneca College ) `---OO-------------------------------O---' Total Fare Price: 0.00 ---------- Enter the following invalid values: 44,20 >44,20 Out of service! ---------- Enter the following invalid values: 24,25 >24,25 Out of service! ---------- END Operator <<, Operator >>, display and read test Type Conversion operator tests 0 Passengers: 0.00 Dollars total fare. --------------- 20 Passengers: 2506.80 Dollars total fare. --------------- This bus is out of service! END Type Conversion operator tests Unary operator tests b1: 10 b2: 0 --b1; --b2; Passenger removed! Bus empty! b1: 9 b2: 0 -------------------------------- ++b1; ++b1; --b2; Passenger added! Bus full! Passenger added! b1: 10 b2: 1 -------------------------------- b1--; b2--; b2--; Passenger removed! Passenger removed! Bus empty! b1: 9 b2: 0 -------------------------------- b1++; b1++; b2++ Passenger added! Bus full! Passenger added! b1: 10 b2: 1 -------------------------------- Binary Member operator tests b1: 0, b2: 7, b3: 8 b1 = b2 += b3; b1: 10, b2: 10, b3: 5 bad += b3; bad: -1, b3: 5 --------------------------------------------- b1 = 20; b2 = 2; b1: -1, b2: 2 b1 = 2; b1: -1 --------------------------------------------- b1 += 1; b2 += 1; b3 += 4; b1: -1, b2: 3, b3: 9 --------------------------------------------- b1: 5, b2: 10, b3: 10 b1: ___________________ | [2][2][1][ ][ ]|_\_ | Seneca College ) `---OO----------O---' Total Fare Price: 626.70 b2: ___________________ | [2][2][2][2][2]|_\_ | Seneca College ) `---OO----------O---' Total Fare Price: 1253.40 b3: _______________________________ | [2][2][2][2][2][ ][ ][ ][ ]|_\_ | Seneca College ) `---OO----------------------O---' Total Fare Price: 1253.40 b1 has 5 passengers and b2 is 10 passengers therefore thier head counts are different b2 has 10 passengers and b3 is 10 passengers therefore thier head counts are equal --------------------------------------------- Binary non-member operator test There are 5 passengers at the bus stop and there are 10 passengers on the bus. When the passengers get off the bus there will be 15 passengers at the bus stop!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started