Answer to Question #213173 in C++ for Hemambar

Question #213173

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.


1
Expert's answer
2021-07-19T16:58:31-0400
/******************************************************************************
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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS