Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm having a problem with my code and would like some help with it. This is my code: #include using namespace std; class Table {

image text in transcribed

I'm having a problem with my code and would like some help with it.

This is my code:

#include using namespace std;

class Table { public: void SetSeatA( int personA ); void SetSeatB( int personB ); int GetSeatA(); int GetSeatB(); void SwapSeats(); private: int seatA; int seatB; };

int main(){ Table t; int person; cin >> person; t.SetSeatA(person); cin >> person; t.SetSeatB(person); t.SwapSeats(); cout

When I run my code I get this error:

main.cpp: In function 'int main()': main.cpp:29:4: error: return-statement with no value, in function returning 'int' [-fpermissive] return;

7.22 Day 20: Swapping w/ Private Data Students This content is controlled by your instructor, and is not zyBooks content. Direct questions or concerns about this content to your instructor. If you have any technical issues with the zyLab submission system, use the "Trouble with lab?" button at the bottom of the lab. swapping Seats w/ Private Data Create public members to access private members. We'll do this activity in class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions