nly for-loops, if statements, and arrays Write a program in java that uses that creates a 30-element array of random integers to represent Fahrenheit temperatures, ensuring that all temperatures range from 10 to 75, inclusive.  Then execute a custom method with the array as its only argument. The method should begin by using a loop to print the array in 6 rows and 5 columns, with all columns being seven characters wide. Duplicates are okay. This same loop should determine how many temperatures in the array are below freezing.  Use this figure to declare an new array of integers named freezing. Process the array again, but this time with a foreach loop, and add the freezing temperatures to the freezing array. Return this new array back to main. Report the number of temperatures that were below freezing, sort them, and print them all on one line separated by spaces.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

only for-loops, if statements, and arrays

Write a program in java that uses that creates a 30-element array of random integers to represent Fahrenheit temperatures, ensuring that all temperatures range from 10 to 75, inclusive.  Then execute a custom method with the array as its only argument. The method should begin by using a loop to print the array in 6 rows and 5 columns, with all columns being seven characters wide. Duplicates are okay. This same loop should determine how many temperatures in the array are below freezing.  Use this figure to declare an new array of integers named freezing. Process the array again, but this time with a foreach loop, and add the freezing temperatures to the freezing array. Return this new array back to main. Report the number of temperatures that were below freezing, sort them, and print them all on one line separated by spaces.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Arrays
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
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