Question: Write a piece of java code to solve the following. Assume that you have an array of integers call arr. ( no need to declare

Write a piece of java code to solve the following.

Assume that you have an array of integers call arr. ( no need to declare it or fill it up, assume it is already there). This array is of size SIZE.

You will read one number int num from the user.

You will search for num in the array.

  • If you find it,
    • You will print out how many times num is found within the array.
  • If you do not find it,
    • You will find the amount of numbers that are smaller than num.

Please label your output properly. Example "num was found x times" OR "num was not found and there are y numbers smaller than it"

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!