0% found this document useful (0 votes)
105 views2 pages

Codes PDF

Uploaded by

Prajwal patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views2 pages

Codes PDF

Uploaded by

Prajwal patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Create package com

Create class Account in com package with attributes as below. Constructor takes parameters in same
sequence as per the image. Create getters and setters.

Create class AccountDemo in com package with main method and other two static methods as below.

Method “depositInterest” will take one Account object and double value. The double value represents
interest percentage out of 100. Method will update balance of the object passed increasing as per
mentioned percentage and return the updated balance value.

Method getAccountsForSpecificCustomer will take array of Account objects and customer id. It will
return array of accounts with specified customer id in descending order of account id.

Please ensure that class names, attribute names, method signature etc. is same as above. Else your code
will fail and score would be zero.

Refer below sample main method and test the output. You can copy the same code in main method and
test the implementation.

Next submit the code in iASCERT for evaluation. Also, upload the code in iON assignment activity.

Sample main method:

public static void main(String[] args) {


// TODO Auto-generated method stub

Account[] accounts = new Account[5];


accounts[0] = new Account(1,1,"SA",10000);
accounts[1] = new Account(2,2,"CA",20000);
accounts[2] = new Account(3,1,"SA",30000);
accounts[3] = new Account(4,2,"CA",40000);
accounts[4] = new Account(5,3,"SA",50000);

double d = AccountDemo.depositInterest(accounts[0], 10.0);


System.out.println(d);
System.out.println(accounts[0].getAccountBalance());

Account[] acc = AccountDemo.getAccountsForSpecificCustomer(accounts, 2);

for(Account a : acc)
{
System.out.println(a.getAccountId());
}

Output:

11000.0
11000.0
4
2

You might also like