-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoops.cpp
More file actions
71 lines (56 loc) · 1.09 KB
/
oops.cpp
File metadata and controls
71 lines (56 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <iostream>
using namespace std;
class Student
{
public:
string fName;
string lName;
int age;
int marks;
void setFName(string);
void setLName(string);
void setMarks(int);
void setAge(int);
void preview();
};
void Student::setAge(int a)
{
age = a;
}
void Student::setFName(string firstName)
{
fName = firstName;
}
void Student::setLName(string lastName)
{
lName = lastName;
}
void Student::setMarks(int m)
{
marks = m;
}
void Student::preview()
{
cout << "Student details: " << endl;
cout << "Name: " << fName + " " + lName << endl;
cout << "Age: " << age << endl;
cout << "Marks: " << marks << endl;
}
int main()
{
Student student1;
Student student2;
student1.setFName("Josh");
student1.setLName("Wells");
student1.setAge(12);
student1.setMarks(100);
// student1.fName = ;
// student1.lName = "Burger";
// student1.age = 12;
// student1.marks = 99;
// student2.fName = "John";
// student2.lName = "Wells";
// student2.marks = 98;
student1.preview();
return 1;
}