@@ -7,12 +7,40 @@ class User {
77 }
88 loginMessage ( ) {
99 console . log ( `Hi ${ this . username } you are logedin` )
10+ return ( `Hi ${ this . username } you are logedin` )
1011 }
1112}
1213
1314class student extends User {
14- constructor ( ) {
15+ constructor ( username , stuClass , subject , roll ) {
16+ super ( username )
17+ this . stuClass = stuClass ;
18+ this . subject = subject ;
19+ this . roll = roll ;
20+ }
21+ showStudentDetails ( ) {
22+ console . log ( `student : ${ this . username } , ${ this . stuClass } , ${ this . subject } , ${ this . roll } ` )
23+ return ( `student : ${ this . username } , ${ this . stuClass } , ${ this . subject } , ${ this . roll } ` )
24+ }
25+ }
1526
27+ class instructor extends User {
28+ constructor ( username , coursesQty , sellCourse , learner ) {
29+ super ( username )
30+ this . coursesQty = coursesQty ;
31+ this . sellCourse = sellCourse ;
32+ this . learner = learner ;
33+ }
34+ showTeacherDetails ( ) {
35+ console . log ( `teacher : ${ this . username } , ${ this . coursesQty } , ${ this . sellCourse } , ${ this . learner } ` ) ;
1636 }
1737}
1838
39+
40+ const student1 = new student ( "Sujit" , "sujit@gmail.com" , "Computer Science" , 80 )
41+ const instructor1 = new instructor ( "SujitTomar" , 15 , 235 , 80000 )
42+
43+ student1 . loginMessage ( ) ;
44+ student1 . showStudentDetails ( )
45+
46+ instructor1 . showTeacherDetails ( )
0 commit comments