Create two classes IntArray to store the set of integer numbers and FloatArray to store decimal
numbers. Add a member function read() for both classes for reading inputs. Create two objects ‘x’
for IntArray and ‘y’ for FloatArray. Read the inputs for x and y. Using a friend function maxmin(x,y),
display the maximum and minimum among the set of integers and decimal numbers.
/******************************************************************************
Create two classes IntArray to store the set of integer numbers and FloatArray to store decimal
numbers. Add a member function read() for both classes for reading inputs. Create two objects ‘x’
for IntArray and ‘y’ for FloatArray. Read the inputs for x and y. Using a friend function maxmin(x,y),
display the maximum and minimum among the set of integers and decimal numbers.
*******************************************************************************/
#include <iostream>
using namespace std;
class IntArray{
private:
int arr1[5];
public:
void read(){
cout<<"\nEnter integer numbers\n";
for(int i=0;i<5;i++){
cin>>arr1[i];
}
}
};
class FloatArray{
private:
public:
float arr2[5];
void read(){
cout<<"\nEnter float numbers\n";
for(int i=0;i<5;i++){
cin>>arr2[i];
}
}
};
int maxmin (IntArray i, FloatArray f)
{
}
int main()
{
IntArray x;
x.read();
FloatArray y;
y.read();
return 0;
}
Comments
Leave a comment