Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Walkthrough programming C++ For the WALKTHROUGH portion of today's Term Test, you will need to determine the EXACT output as well as keep track of

Walkthrough programming C++ image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
For the WALKTHROUGH portion of today's Term Test, you will need to determine the EXACT output as well as keep track of changes in values of ALL class data members in a working C++ program. The exact format for how to track changes is specified BELOW. REQUIRED FILENAME: The CORRECT file name for submitting the WALKTHROUGH portion of today's Term Test (assuming a my.Seneca user id of: "tswift2" and a section of: "A") is: tswift2_PRG355A.211. TT1W.txt NOTE: The filename extension to be used MUST be .txt SPECIFICATIONS: Determine the EXACT output of the following C++ program. In the TRACKING section below, you MUST keep track of the values of ALL the data members for each class instance in main() ONLY. When ANY data member variable's value changes, you are to separate it's previous value with the 'n' character BEFORE appending the variable's NEW value. For example, to keep track of member variable 'a' in the Ocean object named 'one' in main(), you would write (assuming the integer values change from uninitialized to -1 to 0 to 1): int a=-1nw1 For example, to keep track of member variable 's' in the Ocean object named 'one' in main(), you would write (assuming the string values change from uninitialized to "C" to "CA" to "CAT"): char s[41] =C-CACAT So that, the TRACKING section for Ocean object named "one" would be: Ocean one: char s1411=CCACAT So that, the TRACKING section for Ocean object named "one" would be: Ocean one: char [41] -C-CANCAT int sk= int In int a-1 int b= To submit, paste the output from BOTH the TRACKING and OUTPUT areas (without the comments) into this web form. #include using namespace std; #include class Ocean { char s[41]; int sk; int in; int a; int b; void set(const char *str, int n); public: Ocean(const char *str); Ocean(const char *str, int n); void show(); void operator+=(Ocean x); void Ocean::set(const char *str, int n) { strcpy(s, str); ln strlen(s); sk = n; a = b = 4; 3 Ocean::Ocean(const char *str) { set(str, 2); a++; } Ocean::Ocean(const char *str, int n) { set(str, n); bH; } void Ocean::show() { for(int i = 0; i ln >= 7) { this->b++; cout b a++; cout a s[i + this->n] X.s[i]; } this->ln += x.ln; if(this->sk sk = x.sk; int main() Ocean one ("SVEYEA"); one.show(); Ocean two("TI 021 DPW4 A5", 3), three("WHEELS", 5), four("YMCE"); two.show(); cout using namespace std; #include class Ocean { char s[41]; int sk; int in; int a; int b; void set(const char *str, int n); public: Ocean(const char *str); Ocean(const char *str, int n); void show(); void operator+=(Ocean x); void Ocean::set(const char *str, int n) { strcpy(s, str); ln strlen(s); sk = n; a = b = 4; 3 Ocean::Ocean(const char *str) { set(str, 2); a++; } Ocean::Ocean(const char *str, int n) { set(str, n); bH; } void Ocean::show() { for(int i = 0; i ln >= 7) { this->b++; cout b a++; cout a s[i + this->n] X.s[i]; } this->ln += x.ln; if(this->sk sk = x.sk; int main() Ocean one ("SVEYEA"); one.show(); Ocean two("TI 021 DPW4 A5", 3), three("WHEELS", 5), four("YMCE"); two.show(); cout

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

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago