ava code Lab 3 Problem Statement Write a program that reads in ten integers and displays the number of distinct numbers and the list of distinct numbers. (Note: distinct means unique or different. So if the user enters ten 5s, there is only one distinct number, which is 5.) You may use arrays and/or ArrayLists. All ten integers should be read from the user with one prompt. The integers entered should not be limited to any particular range. You may assume that the user will enter only valid integers. You must break the problem down into these separate methods that are each called from the main method: getUserInput findDistinctNumbers outputResults No global variables are allowed. Following is a sample run of the program: Enter ten integers separated by spaces: 1 2 -3 2 1 6 -3 -4 2 The number of distinct numbers is 5 The distinct numbers are 1 2 -3 6 -4

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 16PE
icon
Related questions
Question
Java code Lab 3 Problem Statement Write a program that reads in ten integers and displays the number of distinct numbers and the list of distinct numbers. (Note: distinct means unique or different. So if the user enters ten 5s, there is only one distinct number, which is 5.) You may use arrays and/or ArrayLists. All ten integers should be read from the user with one prompt. The integers entered should not be limited to any particular range. You may assume that the user will enter only valid integers. You must break the problem down into these separate methods that are each called from the main method: getUserInput findDistinctNumbers outputResults No global variables are allowed. Following is a sample run of the program: Enter ten integers separated by spaces: 1 2 -3 2 1 6 -3 -4 2 The number of distinct numbers is 5 The distinct numbers are 1 2 -3 6 -4
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT