12.1994 Gas Prices
In the student sample programs for this book, you will find a text file named 1994_Weekly_Gas_Averages.txt. The file contains the average gas price for each week in the year 1994. (There are 52 lines in the file. Line 1 contains the average price for week 1, line 2 contains the average price for week 2, and so forth.) Write a
- Display the lowest average price of the year, along with the week number for that price, and the name of the month in which it occurred.
- Display the highest average price of the year, along with the week number for that price, and the name of the month in which it occurred.
- Display the average gas price for each month. (To get the average price for a given month, calculate the average of the average weekly prices for that month.)
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Starting Out with Java: Early Objects (6th Edition)
Additional Engineering Textbook Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Modern Database Management (12th Edition)
Java How To Program (Early Objects)
Problem Solving with C++ (9th Edition)
- Description Create an application that maintains an array of your home inventory and displays the contents of the array in a list box. For this assignment, we will be using an array. In later chapters, we will modify this application to use a database or an external text file. The application should look like: g My Home Inventory Home Inventory Item Description Ist Homelnventory Serial Number Cost ADD DELETE REFRESH BYE Detailed Instructions 1. Define arrays for Item Description, Serial Number, and Cost after the Public Form Q and before any click of page load events. 2. In the Page Load Event, populate the Home Inventory List Box with the data from the arrays using the format: "ItemDecription (SerialNumber, Cost)". 3. If the ADD button is clicked, add the Item Description, Serial Number, and Cost to the Home Inventory List Box and to the appropriate arrays. 4. If the DELETE button is clicked, remove the item from the Home Inventory List Box and corresponding arrays. 5. If the REFRESH…arrow_forwardProgramming Language: C++ Create a structure Student and ask the user how many students. Create an array which will save the number of students in the input. Ask for the data of the first and last student and display them.arrow_forwardAssignment 5C: Level Map Creator. There are a variety of ways that game developers store their level layouts. One simple method is to associate level elements with certain symbols, and then storing them in a 2D grid inside a text file. We will use our knowledge of 2D arrays to create a very simple Level Map Creator tool. The program should prompt the user to enter a width and height for the level. Then it should initialize a 2D array and fill every element with the "*" symbol. Afterwards, the user should be given the following options via a menu: 1. Clear Level Re-initialize the 2D array and fill every element with the "*" symbol. 2. Add Platform Prompt the user to enter a starting point and length for the horizontal platform. Replace those elements in the 2D array with the "=" symbol. If the length is longer than the number of columns (or out of bounds), notify the user that this is not possible. 3. Add Item Prompt the user to enter a column and row index. Replace that element in the…arrow_forward
- An array can hold as much different data types as you want. True Falsearrow_forwardAssignment 5C: Level Map Creator. There are a variety of ways that game developers store their level layouts. One simple method is to associate level elements with certain symbols, and then storing them in a 2D grid inside a text file. We will use our knowledge of 2D arrays to create a very simple Level Map Creator tool. The program should prompt the user to enter a width and height for the level. Then it should initialize a 2D array and fill every element with the *" symbol. Afterwards, the user should be given the following options via a menu: 1. Clear Level 2. Add Platform Prompt the user to enter a starting point and length for the Re-initialize the 2D array and fill every element with the "** symbol. horizontal platform. Replace those elements in the 2D array with the "=" symbol. If the length is longer than the number of columns |(or out of bounds), notify the user that this is not possible. Prompt the user to enter a column and row index. Replace that element in the 2D array…arrow_forwardQuestion 1 Write a program that declares an array of 100 doubles. The program asks the user to enter a number N between 100, and then: initializes the first N elements of the array to random numbers between 1 and 100. calculates the average of these numbers and displays it. A final loop displays the elements of the array, each on a line, with an indication as to whether that number is lower or higher than the average. For example, if the numbers generated are 5, 28, 3, 8, 15, 7, 22, 6, 1, 4, then the program will print: Average = 9.9 5 28 3 8 15 7 22 6 1 4 11 11 11 -- 11 11 1- —— 11 lower than average higher than average lower than average lower than average higher than average lower than average higher than average lower than average lower than average lower than averagearrow_forward
- # Declare a named constant for array size here. MAX_AVERAGES = 8 # Declare array here. # Write a loop to get batting averages from user and assign to array. averageString = input("Enter a batting average: ") battingAverage = float(averageString) # Assign value to array. # Assign the first element in the array to be the minimum and the maximum. minAverage = averages[0] maxAverage = averages[0] # Start out your total with the value of the first element in the array. total = averages[0] # Write a loop here to access array values starting with averages[1] # Within the loop test for minimum and maximum batting averages. # Also accumulate a total of all batting averages. # Calculate the average of the 8 batting averages. # Print the batting averages stored in the averages array. # Print the maximum batting average, minimum batting average, and average batting average. This is on mindtap pyton what needs to be fixarrow_forwardAn array definition reserves space for the array. true or falsearrow_forwardquestion 2arrow_forward
- The variables numberArray1 and numberArray2 reference arrays that have 100 elements each. Write code that copies the values from numberArray1 to numberArray2arrow_forwarddo both tasksarrow_forwardA single statement that declares a variable and specifies array values as its content is called an array Select one: a.literal b.constructor C.element d.indexarrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning