HomeWork-1:
Jamil: Write a
program to sum an array using Inheritance + constructor + destructor
Rakib: Write a program to find all the even numbers between
1 and 10 using Class + Object + Method (with return type)
Shafi: Write a program to print all the odd numbers between
1 and 10. Use Inheritance + constructor+ method
Minhajul: Write a program to check whether the given number
is odd or even. Use Contructor+desctructor and Method
Tanzuma Akter: Write a program to find the area of circle
and box using inheritance.
Tisha: Write a program to find the sum of all data type
using function overloading.
Monika: Write a program to print all the odd values from a
given array using
Inheritance.
Nayem: write a program to sum and subtract of integer and
float data type using overloading.
Farjana: Write a program find the largest value
from an array. Use inheritance to solve this problem.
Maruf: Write a program to print all the odd values from a
given array using
Constructor.
Konok: find area of box
and rectangle using overloading
Arman:
Tasnin:
morsheda:
///Tisha
ReplyDelete///201930034
#include
using namespace std;
class funOver
{
public:
void number(int X, int Y);
void number(int X, int Y, int Z);
void number(int X, int Y, int Z, int T);
};
void funOver:: number(int X, int Y)
{
cout<< endl << "number is : "<< X+Y;
}
void funOver:: number(int X, int Y, int Z)
{
cout<< endl << "number is : "<< X+Y+Z;
}
void funOver:: number(int X, int Y, int Z, int T)
{
cout<< endl << "number is : "<< X+Y+Z+T;
}
int main()
{
funOver obj;
obj.number(2,3);
obj.number(2,3,4);
obj.number(2,3,4,5);
return 0;
}
using namespace std;
ReplyDelete///MD.SAHIDULLAH
///201930055
///62BATCH
void printOddNumbers(int N)
{
cout << "THANKS AHSAN ARIF SIR !!!\n";
cout << "\nOdd: ";
for (int i = 1; i <= 1* N; i++)
{
if (i % 2 != 0)
cout << i << " ";
}
}
int main()
{
int N = 10;
printOddNumbers(N);
return 0;
}
//Md.Nayem Hossain
ReplyDelete//Id:202010023
//62batch
#include
using namespace std ;
class A
{
public:
int sum(int a,int b)
{
return a+b;
}
int sub(int a,int b)
{
return a-b;
}
float sum(double x,double y)
{
return x+y ;
}
float sub( double x, double y)
{
return x-y ;
}
};
int main()
{
A obj ;
cout<<obj.sum(10,20)<<endl;
cout<<obj.sub(20,10)<<endl;
cout<<obj.sum(20.400,10.200)<<endl;
cout<<obj.sub(20.400,10.200)<<endl;
}
#include
ReplyDeleteFARJANA KAMAL KONOK
20930701
\
using namespace std;
int largest(int arr[], int n)
{
int i;
int max = arr[0];
for (i = 1; i < n; i++)
if (arr[i] > max)
max = arr[i];
return max;
}
int main()
{
int arr[] = {10, 324, 45, 90, 9808};
int n = sizeof(arr) / sizeof(arr[0]);
cout << "Largest in given array is "
<< largest(arr, n);
return 0;
}
// Re-post
ReplyDelete//Md.Nayem Hossain
//Id:202010023
//63batch
#include
using namespace std ;
class A
{
public:
int sum(int a,int b)
{
return a+b;
}
int sub(int a,int b)
{
return a-b;
}
float sum(double x,double y)
{
return x+y ;
}
float sub( double x, double y)
{
return x-y ;
}
};
int main()
{
A obj ;
cout<<obj.sum(10,20)<<endl;
cout<<obj.sub(20,10)<<endl;
cout<<obj.sum(20.400,10.200)<<endl;
cout<<obj.sub(20.400,10.200)<<endl;
}
//jamil zilani
ReplyDelete//201930092
#include
#include
using namespace std;
class B
{
public:
int i, arr[3];
int sum=0;
void add()
{
sum=arr[0]+arr[1]+arr[2];
cout<< sum;
}
};
class A : public B
{
public:
A()
{
cout<< "Enter your array elements: ";
for(i=0; i<3; i++)
{
cin>> arr[i];
}
add();
}
~A()
{
cout<< "\nProgram Finished.";
getch();
}
};
int main ()
{
A obj;
return 0;
}