Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Convert this Java program made in netbeans into a C++ program import java.util.*

ID: 3617179 • Letter: C

Question

Convert this Java program made in netbeans into a C++ program

import java.util.*;

public class distinctnumber

{public static void main(String[] args)
    {Scanner input = new Scanner(System.in);
        inti,j,n=10,max=0,found,number;
        int [] nums =new int[n];
    for(i=0;i<n;i++)
        nums[i]=0;
    for(i=0;i<n;i++)
        {System.out.print("Enternumber "+(i+1)+": ");

number=input.nextInt();
    found=0;
    for(j=0;j<max;j++)
    if(nums[j]==number)
        found=1;
    if(found==0)
        {nums[max]=number;
        max++;
    }
}
    System.out.println("There were "+max+" distinctnumbers entered");
    System.out.print("They are: ");

        for(i=0;i<max;i++)
               System.out.print(nums[i]+" ");
           System.out.println();
    }
}



Explanation / Answer

x.j5tyle="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; ">// Java To C++