Question: Problem 3 Array Comparison te a C++ program that declares two integer arrays named user and random; each has 5 elements, consisting of single-digit numbers

 Problem 3 Array Comparison te a C++ program that declares two

Problem 3 Array Comparison te a C++ program that declares two integer arrays named user and random; each has 5 elements, consisting of single-digit numbers chosen from 1 to 9, with no duplicates. The program calls a userlnput function, which prompts the user to enter 5 distinct digits between I and 9; the user's inputs are stored in the user array The program calls a second function, randomList, which generates 5 distinct random numbers between 1 and 9 (inclusive) and stores them in the array random. The program outputs the two arrays side-by-side, with labels indicating which is the user's list, and which is the computer's list. The program compares the two arrays element-by-element; it they are identical, it outputs that the user has won the game

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!