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

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 3.5CP
icon
Related questions
Question

this is needed in java ,,, please also check how the output should look and the program requirements as well. Thank you

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:
• getUserlnput
o findDistinctNumbers
o 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
Lab2i Requirements
o Create the above program in NetBeans individually.
• Review the course style guide to make sure naming conventions and comments are correct.
• Export your project as a zip and submit it here for grading.
• Find your Lab3 group in Canvas and navigate to the Google spreadsheet linked in the announcement.
• Post your code to the spreadsheet. Remember to place your full name at the top of the column and post all your code, including JavaDoc comments.
Transcribed Image Text: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: • getUserlnput o findDistinctNumbers o 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 Lab2i Requirements o Create the above program in NetBeans individually. • Review the course style guide to make sure naming conventions and comments are correct. • Export your project as a zip and submit it here for grading. • Find your Lab3 group in Canvas and navigate to the Google spreadsheet linked in the announcement. • Post your code to the spreadsheet. Remember to place your full name at the top of the column and post all your code, including JavaDoc comments.
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
Transcribed Image Text: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 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT