Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Daffodil International University

Department of Computer Science and Engineering


Course code: CSE335 Course Title: Pervasive Computing Lab Section: 60_D1
Semester: Spring 2024 Lab Report/Assignment: 2 Course Teacher: DJB
Name: Shafin Ahmed Student ID: 213-15-4290

1) Write a Dart program that defines a Student class with fields name and grade. Include
a method displayInfo() that prints the student's name and grade. Create an instance
of the Student class in the main() function and use it to set the student's name and
grade, then call the displayInfo() method to print the information.

Output
2) Write a Dart program that uses the BankAccount class to perform a sequence of
deposits and withdrawals. Initialize the account with a balance of 500, deposit 300,
withdraw 100, and then print the final balance.

Output

3) Write a Dart program that defines a Bird class that extends the Animal class. Override
the speak() method in the Bird class to print "Bird chirps". In the main() function,
create instances of Dog, Cat, and Bird, assign them to a variable of type Animal, and
call their speak() methods..
Output

You might also like