1. Write a complete java program called Ones. This program should do the following: a. Create an array "numbers" of size 10. b. Fill the array with random integer numbers between 0 and 9 (inclusive). C. Print the numbers inside the array d. Count the occurrence of 1 (one) in this array. e. Print out the total number of the occurrence of 1 (one) in this array. The output should look like the following: Array numbers are: 3165968132 The occurrence of number 1 in the array is: 2 At the end of the exam, upload your file Ones.java to Blackboard.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question
1. Write a complete java program called Ones. This program should do the following:
a.
Create an array "numbers" of size 10.
b. Fill the array with random integer numbers between 0 and 9 (inclusive).
C.
Print the numbers inside the array
d. Count the occurrence of 1 (one) in this array.
e.
Print out the total number of the occurrence of 1 (one) in this array.
The output should look like the following:
Array numbers are:
3165968132
The occurrence of number 1 in the array is: 2
At the end of the exam, upload your file Ones.java to Blackboard.
Transcribed Image Text:1. Write a complete java program called Ones. This program should do the following: a. Create an array "numbers" of size 10. b. Fill the array with random integer numbers between 0 and 9 (inclusive). C. Print the numbers inside the array d. Count the occurrence of 1 (one) in this array. e. Print out the total number of the occurrence of 1 (one) in this array. The output should look like the following: Array numbers are: 3165968132 The occurrence of number 1 in the array is: 2 At the end of the exam, upload your file Ones.java to Blackboard.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Array
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.
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