Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Find error

#incjlude<iostream>
2 using namespace std;
1
3
4 class Test {
5 private:
int x,y;
6
7
8 public:
9.
Test ( cx,
су)
x = Cx;
12
у- су;
13
}
14
15
void add ( int , int)
16
17
18
cout<<" Your total mark is equal to "<<x+y<<endl;
19
if (x+y >=90)
cout<<"Congratulations"<<endl;
20
21
22
else
23
cout<<"Please try again"<<endl;
24
25
26
~Test ( сх, су)
{
28
29
30
};
31
32
int main ( )
33
{
34
Test obj [ ] = (test (45, 35), test (40,25), test (40,50) };
35
for (int i=0; i<3; i++)
{
test[i]. add () ;
38
40
41
return 0;
42
O70 901 2
333 34
H11 L12 11 112 222N 22
N 2 2 23 m333
Transcribed Image Text:#incjlude<iostream> 2 using namespace std; 1 3 4 class Test { 5 private: int x,y; 6 7 8 public: 9. Test ( cx, су) x = Cx; 12 у- су; 13 } 14 15 void add ( int , int) 16 17 18 cout<<" Your total mark is equal to "<<x+y<<endl; 19 if (x+y >=90) cout<<"Congratulations"<<endl; 20 21 22 else 23 cout<<"Please try again"<<endl; 24 25 26 ~Test ( сх, су) { 28 29 30 }; 31 32 int main ( ) 33 { 34 Test obj [ ] = (test (45, 35), test (40,25), test (40,50) }; 35 for (int i=0; i<3; i++) { test[i]. add () ; 38 40 41 return 0; 42 O70 901 2 333 34 H11 L12 11 112 222N 22 N 2 2 23 m333
Select one or more:
Line 15: void add()
Line 5: -Public:
Line 29: };
Line 40: exit (EXIT_FAILURE)
Line 6: int cx, cy:
Line 9: Test (int cx, int cy)
Line 7: int add;
Line 35: obj1 = &test;
Line 37: for (int i=1; i<3; i++)
Line 8: Public:
Line 38: obj[i]. add();
Line 27: -Test(O
Line 22: else if
Line 31: int Test::add( )
Line 34: Test obj [] = {Test(45,35), Test(40,25),Test(40,50) };
Transcribed Image Text:Select one or more: Line 15: void add() Line 5: -Public: Line 29: }; Line 40: exit (EXIT_FAILURE) Line 6: int cx, cy: Line 9: Test (int cx, int cy) Line 7: int add; Line 35: obj1 = &test; Line 37: for (int i=1; i<3; i++) Line 8: Public: Line 38: obj[i]. add(); Line 27: -Test(O Line 22: else if Line 31: int Test::add( ) Line 34: Test obj [] = {Test(45,35), Test(40,25),Test(40,50) };
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY