Professional Documents
Culture Documents
Shazzad OOP
Shazzad OOP
Assignment
CSE 201: Object Oriented Programming
Submitted by:
Name Md. Shazzad Hossain Sharif
Student ID 213002258
Section D4
Date of 02-11-2022
Submission
Submitted to:
Mr. Amit Mondol
Lecturer
CSE, Green University of Bangladesh
Source Code:
package assignment;
import java.util.Scanner;
interface CustomizedInterface
{
public int factorSum(int n);
}
class Myfactor implements CustomizedInterface
{
@Override
public int factorSum(int n)
{
int sum=0;
System.out.print("Devisor of "+n+" is ");
for(int i=1;i<=n;i++)
{
if(n%i==0)
{
sum=sum+i;
System.out.print(+i+" ");
}
}
System.out.println();
return sum;
}
}
public class Assignment {
Output: (Screenshot)
The End