Only Few Seats Left for Advanced Certification Courses on Data Science, ML & AI by E&ICT Academy IIT RoorkeeApply Now
Let's try to write a simple class.
This would be class named
Student having below members.
nameof type String
sexof type Char (M / F)
gradeof type Integer (ex - 1, 2, 3, 4 etc)
ageof type of Integer (ex - 7, 10, 13 etc)
Using the resulting class, one should be able to instantiate new objects like below:
var stu1 = new Student("John Doe", 'M', 15, 23 );
The class members of the object should be accessible as below:
var name_stu = stu1.name var sex_stu = stu1.sex var grade_stu = stu1.grade var age_stu = stu1.age
Switch to the Jupyter tab.
Write the code of the class in Jupyter.
Press Shift+Enter to execute the code.
Try to create objects of the class and make sure that it works as per the above requirements.
Click on "Submit Answer".
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here