Rewrite the Assignment using C++ Class implementation. Name your class MyClass.
ID: 3646672 • Letter: R
Question
Rewrite the Assignment using C++ Class implementation. Name your class MyClass. Create all necessary functions and constructors. Write your own main() program to test and verify that your class works.Below is your previous Assignment and code
Write an application program that reads in a list of integer numbers and print out the sum of all numbers, the average, the lowest and the highest value entered. The first input number indicates how many numbers the program is going to read. For example, if the first number
import java.io.*;
import javax.swing.JOptionPane;
class array
{
public static void main(String args[])
{
String firstNumber;
int i=0,size;
float average=0,sum=0;
firstNumber =JOptionPane.showInputDialog ( "Enter the number of integers" );
size=Integer.parseInt ( firstNumber);
int a[]=new int[size];
for(i=0;i<size;i++)
a[i]=Integer.parseInt
(JOptionPane.showInputDialog
( "Enter the values" ));
int min=a[0],max=a[0];
for(i=0 ;i<size;i++)
{
sum=sum+a[i];
if(a[i]<min)
min=a[i];
if(a[i]>max)
max=a[i];
}
average=(sum/size);
JOptionPane.showMessageDialog(null,"result: sum"+sum+" min:"+min+" max:"+max+" average:"+average);
}
}