roject Classes Debug composition.cpp 1 #include 2 3 using namespace std; 4 5 class student private: string name; int matric; public: void setStudent(string n, int m) 7 8 10 11 12 E 13 name-n; 14 matric-m; 15 16 int getMatric() 17 18 return matric; 19 20 string getname () 21 22 return name; 23 24 student() {name-" " matric-e; } student() 25 26 27 28 29 class CPM213Test 30E ( 31 int mark; student stinfor; //composition - member of a class ia an object of another public: void setTest(string n, int mat, int tm) 32 33 34 35 E 36 stinfor.setStudent(n, mat); Compiler (3) e Resources dlh Compile Log V Debug C Find Results 3 Close ine Col File Message C:\Users\huawei Desktop\CPM213 LAB\composition.cpp [Error] "Void' does not name a type CAUsers\huawei\Desktop\CPM213 LAB\composition. In function 'int main0': C:\Users\huawei Desktop\CPM213 LAB\composition.cpp [Error] 'class CPM213Test' has no member named 'display Test 9

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

what wrong with my coding

* C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp - Dev-C++ 5.11
O X
File Edit Search View Project Execute Tools AStyle Window Help
TDM-GCC 4.9.2 64-bit Release
(globals)
Project Classes Debug
composition.cpp
1
#include <iostream>
2
3
using namespace std;
4
5
class student
private:
string namej
int matric;
public:
void setStudent (string n, int m)
{
7
10
11
12 E
13
name=n;
14
matric=m;
15
int getMatric()
{
return matric;
}
string getname ()
{
return name;
16
17 E
18
19
20
21
22
23
student ()
{name=" "; matric=0; }
nstudent()
{ }
24
25
26
27
};
class CPM213Test
28
29
30 E {
31
int mark;
student stinfor; //composition - member of a class ia an object of another
public:
void setTest(string n, int mat, int tm)
{
stinfor.setStudent(n, mat);
32
33
34
35 E
36
88 Compiler (3)
Resources dh Compile Log V Debug A Find Results
Close
Line
Col
File
Message
C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp [Error] 'Void' does not name a type
C:\Users\huawei\Desktop\CPM213 LAB\composition. In function 'int main()':
C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp [Error] 'class CPM213Test' has no member named 'display Test'
39
9
48
Line: 39
Col: 9
Sel: 0
Lines: 49
Length: 812
Insert
Done parsing in 0.016 seconds
1:23 AM
DEV
O Type here to search
4) O ENG
IMI
13/12/2021
32°C Rain
Transcribed Image Text:* C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp - Dev-C++ 5.11 O X File Edit Search View Project Execute Tools AStyle Window Help TDM-GCC 4.9.2 64-bit Release (globals) Project Classes Debug composition.cpp 1 #include <iostream> 2 3 using namespace std; 4 5 class student private: string namej int matric; public: void setStudent (string n, int m) { 7 10 11 12 E 13 name=n; 14 matric=m; 15 int getMatric() { return matric; } string getname () { return name; 16 17 E 18 19 20 21 22 23 student () {name=" "; matric=0; } nstudent() { } 24 25 26 27 }; class CPM213Test 28 29 30 E { 31 int mark; student stinfor; //composition - member of a class ia an object of another public: void setTest(string n, int mat, int tm) { stinfor.setStudent(n, mat); 32 33 34 35 E 36 88 Compiler (3) Resources dh Compile Log V Debug A Find Results Close Line Col File Message C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp [Error] 'Void' does not name a type C:\Users\huawei\Desktop\CPM213 LAB\composition. In function 'int main()': C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp [Error] 'class CPM213Test' has no member named 'display Test' 39 9 48 Line: 39 Col: 9 Sel: 0 Lines: 49 Length: 812 Insert Done parsing in 0.016 seconds 1:23 AM DEV O Type here to search 4) O ENG IMI 13/12/2021 32°C Rain
* C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp - Dev-C++ 5.11
O X
File Edit Search View Project Execute Tools AStyle Window Help
TDM-GCC 4.9.2 64-bit Release
(globals)
Project Classes Debug
composition.cpp
matric=m;
}
int getMatric()
14
15
16
17 A
return matric;
}
string getname ( )
{
18
19
20
21 E
22
return name;
23
student ()
{name=" "; matric=0; }
nstudent()
{ }
24
25
26
27
};
class CPM213Test
28
29
30 E {
int mark;
student stinfor; //composition - member of a class ia an object of another
public:
void setTest(string n, int mat, int tm)
{
stinfor.setStudent (n, mat);
mark=tm;
31
32
33
34
35 E
36
37
38
Void displayTest()
{
cout « stinfor.getname () <« "\t" « stinfor.getMatric() « "\t" « mark « endl;
40 E
41
42
};
int main()
45 E {
43
44
CPM213Test result;
result.setTest("Fatin", 151722, 98);
result.displayTest();
}
46
47
48
49
88 Compiler (3)
Resources dh Compile Log V Debug A Find Results
Close
Line
Col
File
Message
C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp [Error] 'Void' does not name a type
C:\Users\huawei\Desktop\CPM213 LAB\composition. In function 'int main()':
C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp
39
9
48
[Error] 'class CPM213Test' has no member named 'display Test'
Line: 39
Col: 9
Sel: 0
Lines: 49
Length: 812
Insert
Done parsing in 0.016 seconds
1:23 AM
DEV
O Type here to search
4) O ENG
IMI
13/12/2021
32°C Rain
O
Transcribed Image Text:* C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp - Dev-C++ 5.11 O X File Edit Search View Project Execute Tools AStyle Window Help TDM-GCC 4.9.2 64-bit Release (globals) Project Classes Debug composition.cpp matric=m; } int getMatric() 14 15 16 17 A return matric; } string getname ( ) { 18 19 20 21 E 22 return name; 23 student () {name=" "; matric=0; } nstudent() { } 24 25 26 27 }; class CPM213Test 28 29 30 E { int mark; student stinfor; //composition - member of a class ia an object of another public: void setTest(string n, int mat, int tm) { stinfor.setStudent (n, mat); mark=tm; 31 32 33 34 35 E 36 37 38 Void displayTest() { cout « stinfor.getname () <« "\t" « stinfor.getMatric() « "\t" « mark « endl; 40 E 41 42 }; int main() 45 E { 43 44 CPM213Test result; result.setTest("Fatin", 151722, 98); result.displayTest(); } 46 47 48 49 88 Compiler (3) Resources dh Compile Log V Debug A Find Results Close Line Col File Message C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp [Error] 'Void' does not name a type C:\Users\huawei\Desktop\CPM213 LAB\composition. In function 'int main()': C:\Users\huawei\Desktop\CPM213 LAB\composition.cpp 39 9 48 [Error] 'class CPM213Test' has no member named 'display Test' Line: 39 Col: 9 Sel: 0 Lines: 49 Length: 812 Insert Done parsing in 0.016 seconds 1:23 AM DEV O Type here to search 4) O ENG IMI 13/12/2021 32°C Rain O
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education