
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Write an
Write a
- Assume that the temperatures will fall between -40 and 110, inclusive.
- You'll print the temperature and then the number of days for each temperature that was the high at least once. So your output will be in two columns.
- The key to this is that you'll have an array where the indices of the array represent the temperatures and the contents are the number of days where that temperature was the high.

Transcribed Image Text:Part 2
Implement the program you designed for prelab. Remember that you are using the indices
of the array to represent the temperatures and then storing the actual counts in the array.
Do not store any temperatures in an array. Your printout should not include any highs
that never appeared in the file, only values that actually show up in the file.
The temperatures will be read from the file temps.txt. Use the example code in
ArrayManager's fillArray method to help you write the file reading piece.
Call your program HighTemps.java. You may do this entire program in main if you wish.
Sample output:
Temperatures
Number of Days
-40
3
-10
1
-3
1
11
1
45
3
69
78
2
79
1
89
1
99
1
110
1
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps with 2 images

Knowledge Booster
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
- A run is a sequence of adjacent repeated values. Write a program that generates a sequence of 20 random die tosses in an array and that prints the die values, marking the runs by including them in parentheses, like this: 12 (5 5) 3 124 3 (2 22 2) 3 6 (5 5) 6 3 1 Use the following pseudocode: 1. Set a boolean variable inRun to false 2. For each valid index i in the array A. If inRun If values[i] is different from the preceding value Print ) o inRun = false · If not inRun o If values[i] is the same as the following value Print ( inRun = true. Print values[i] 3. If inRun, print )arrow_forwardthis is for java see image thank youarrow_forwardWrite a Java program that asks the user to enter the size for an Array. Then fill the array with the arithmetic series that starts at 3.5 and goes up by 3. (Hint: use for loop). Display the sum of all the numbers in the array. Display the Average of all the numbers in the array.arrow_forward
- Write a program in JAVA to input the number of elements in an array, also input the values in the array from the console. Replace all those elements which are even and greater than 5, with -99. Print the final array. Constraints: The array should initially not contain -99. The value of the number of elements should not be greater than 50.arrow_forwardWrite a program that generates 10 random numbers (0~99). Save the numbers into arraylnt and calculate the sum. .data arraylnt Byte 10 DUP(?) Displays the array and the sum as follows: The random numbers are: Хх хх хх хх хх хх ... The sum is XXXXarrow_forwardIn JAVAarrow_forward
- Using Java language, do the following: Declare an array of double of size 365 to store daily temperatures for one year. Using this data structure, write a code fragment to find / The hottest and coldest days of the year. / The average temperature of the year. / The difference between the hottest and coldest days. • Hint: It is better to build a method for each task and notice that the hottest is the largest value and the coldest is the smallest value.arrow_forwardPlease write in Javaarrow_forwardWrite a program to do the following task: Declare a two-dimensional array with 3 rows and 4 columns and fill it with random integers in the range of 0 to 100. Then create a one-dimensional array of doubles whose elements are the average values of each of the rows of the two-dimensional array. Output the two-dimensional array with the average of each row displayed at the end of each line.using java programming different methodarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education