Write a program that creates two arrays of size 8 representing card numbers in a game. The valid numbers are between 1 and 9 only. The user must enter 8 valid numbers to fill the first array. Then, the program must generate 8 random numbers to fill the second array. The program must display the numbers generated and then how many matching card numbers (equal value) at the same index in both arrays respectively. Sample run 1: Enter 8 card numbers between 1 and 9: 2 1 47 39 8 5 The cards generated by the computer are: 5 49 2 4 79 2 You have o matching card (s). Sample run 2: 3 e5 9 2 8 1 9 Enter 8 card numbers between 1 and 9: The cards generated by the computer are: 6 e8 8 5 7 4 5 You have 1 matching card (s).
Write a program that creates two arrays of size 8 representing card numbers in a game. The valid numbers are between 1 and 9 only. The user must enter 8 valid numbers to fill the first array. Then, the program must generate 8 random numbers to fill the second array. The program must display the numbers generated and then how many matching card numbers (equal value) at the same index in both arrays respectively. Sample run 1: Enter 8 card numbers between 1 and 9: 2 1 47 39 8 5 The cards generated by the computer are: 5 49 2 4 79 2 You have o matching card (s). Sample run 2: 3 e5 9 2 8 1 9 Enter 8 card numbers between 1 and 9: The cards generated by the computer are: 6 e8 8 5 7 4 5 You have 1 matching card (s).
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
Related questions
Question
100%
What is the solution of this problem using java language?
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT