. Create an abstract class ‘Bank’ with abstract methods ‘getBalance’ and ‘deposit’. ‘BankA’, ‘BankB’ and ‘BankC’’ are subclasses of class ‘Bank’, each having methods named ‘getBalance’ and ‘deposit’. 1000, 1500 and 2000 are deposited in banks A, B and C respectively using the ‘deposit’ method. Call the ‘getBalance’ method to print balance for the three classes. 2. Write a Java program to – Create an interface called Vehic

Course: CSE – 202

Task No: 3

1. Create an abstract class ‘Bank’ with abstract methods ‘getBalance’ and ‘deposit’. ‘BankA’, ‘BankB’ and ‘BankC’’ are subclasses of class ‘Bank’, each having methods named ‘getBalance’ and ‘deposit’. 1000, 1500 and 2000 are deposited in banks A, B and C respectively using the ‘deposit’ method. Call the ‘getBalance’ method to print balance for the three classes.

2. Write a Java program to –

  • Create an interface called Vehicle. In this interface create a method called printData()
  • Implement interface Vehicle by classes Car, SUV, Minivan
  • In each class write a method printString() and create a string which holds all data
  • In the method printData() in each class prints the data using printString() method.

Submission:

  • A lab report containing codes and screenshot of outputs. [File format: task_no_ID.pdf, example: task_3_20191234.pdf|
  • Don’t submit any zip file.

Penalty:

  • Plagiarism: If it can be proven beyond reasonable doubt that the assignment code(s) was plagiarized, the code will be invalid and no marks will be attributed.

GET HELP WITH YOUR PAPERS

GET THIS ANSWER FROM EXPERTS NOW

WhatsApp
Hello! Need help with your assignments? We are here
Don`t copy text!