int main() { Test Obj; cout


What should be added in code.


Name line..



int main() {<br>Test Obj;<br>cout <« Obj.f2() « endl;|<br>int val = Obj.f3(10).f2();<br>f4(Obj);<br>cout <« Obj.f2() « endl;<br>system(

Extracted text: int main() { Test Obj; cout <« obj.f2()="" «="" endl;|="" int="" val="Obj.f3(10).f2();" f4(obj);="" cout=""><« obj.f2()="" «="" endl;="" system("pause");="" return="" 0;="" }="" hint:="" you="" can="" only="" make="" changes="" at="" the="" lines="" highlighted="" with="" yellow="" and="" numbered="" 1="" to="" 5="" b="" i="" line1:="" line2:="" line3:="" line4:="">
Given the following code, what should be added/modified so the code works well, specify the line and the code<br># include <iostream><br>using namespace std;<br>class Test {<br>//...<br>//...<br>int K;<br>1<br>public:<br>void f1(int v) { K = v++; }<br>int f2() { return K; }<br>Test f3(int K) {<br>if (K == 0)<br>K = K; //....<br>else<br>K = 8; //....<br>return K; //...<br>}<br>};<br>void f4(const Test &T) {<br>int x;<br>if (T.K == 7)<br>x = T.K;<br>else<br>x = T.K + 3;<br>}<br>class test {<br>Test MyTest;<br>public:<br>test() {}<br>void print() { cout <« MyTest.K << endl; }<br>};<br>

Extracted text: Given the following code, what should be added/modified so the code works well, specify the line and the code # include using namespace std; class Test { //... //... int K; 1 public: void f1(int v) { K = v++; } int f2() { return K; } Test f3(int K) { if (K == 0) K = K; //.... else K = 8; //.... return K; //... } }; void f4(const Test &T) { int x; if (T.K == 7) x = T.K; else x = T.K + 3; } class test { Test MyTest; public: test() {} void print() { cout <« mytest.k="">< endl;="" }="">

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here