1994 Weekly Gas Graph 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.) Using matplotlib, write a Python program that reads the contents of the file then plots the data as either a line graph or a bar chart. Be sure to display meaningful labels along the X and Y axes, as well as the tick marks.
Q: C++ Given header is in image main.cpp #include "IntList.h" #include using namespace std; int…
A: Answer is given below .
Q: write a c++ code uisng linked list for quiz. In quiz game, questions are chosen in such a a way…
A: In quiz game,questions are chosen in such a away that they cover all fields of a typical quiz…
Q: Morse code is a code where each letter of the English alphabet, each digit, and various punctuation…
A: Morse code is a method used in telecommunication to encode text characters as standardized sequences…
Q: Add a while loop to the Imperial BMI procedure below. def BMIImperial(height, weight, bmiList,…
A: First Step is declare bmiList and Category list and pass height, weight, bmiList and Category in the…
Q: Grade Book A teacher would like to assign a letter grade to a student, based on student's test…
A: #include<iostream>#include<string.h>#include<stdlib.h>using namespace std;string…
Q: partNames is a String array containing 100 elements. Write a for loop (standard for loop, not…
A: Here I am taking only ten elements you can add more elements in array and it print the result in the…
Q: data structures nested elements parameters What replaces when declaring a new ArrayList? O a. the…
A: Given: When defining a new ArrayList, what substitutes T>?
Q: PYTHON PROGRAMMING There are six quizzes with grades 0 through 10. The lowest grade will be dropped…
A: class quizzes(object): # defining class for quizzes mark = [] # variable d_marks = [] def…
Q: Use pseudocode in designing the logic. Laramie Park District has files of participants in its…
A: Pseudocode:- Pseudocode resembles program code however without being restricted to the syntax of an…
Q: ArrayList Application: Create an empty ArrayList. Take names from user as many as he/she would like…
A: GIVEN: Develop a Java program of Arraylist application that does the following Insert elements…
Q: etween equally spaced X coordinates. Create a list of equally spaced X coordin. *a based on the…
A: I have written the PYTHON code below:
Q: Assignment 5A: Fibonacci Sequence. You may have learned about Fibonacci Sequences in high school or…
A: Step 1 : Start Step 2 : In the main function , Define a while loop which iterates till the user…
Q: subject: microprocesor and assembly language Write a program that displays a string in all possible…
A: Answer :- PROGRAM INCLUDE Irvine32.inc.datacount DWORD ?.codemain PROC mov eax, 0 + (0 * 16)…
Q: A college must track equipment items purchased using special funds. Create a struct name Inventory…
A: Answer: Here I have write a code in C++ (CPP) please find the code below: I have covered all the…
Q: JAVA INTRO Create a program that generates a report that displays a list of students, classes they…
A: Given : Create a program that generates a report that displays a list of students, classes they are…
Q: Capital Quiz Write a program that creates a map containing the U.S. states as keys, and their…
A: Given:
Q: C) Create a program that generates an eight-digit account number. The program should generate seven…
A: Given: Create a program that generates an eight-digit account number. The program should generate…
Q: The mean of a list of numbers is its arithmetic average. The median of a list is its middle value…
A: Start Loop to acept array elements Calculate sum of array elemenets store in mean median <-…
Q: 9. Chess Board Write a program that draws an 8 X 8 chess board, with alternating gray and white…
A: As per guidelines we can answer only one question for answer of other question please ask separately
Q: Aquarium Fish - length: double - width: double - height: double fishes: Fish [ ] - name: String -…
A: If you want to run the code you can run it on online GDB compiler. I have bolded out the code for…
Q: Expand positive integer intervals def expand_intervals(intervals): An interval of consecutive…
A: Code: from typing import List, NoReturn, Any def collapse_intervals(items: List[int]) -> str:…
Q: SOLVE a question from "Starting out with Python" by Tony Gaddis Chapter 8, question number 14, the…
A: Open and read the file GasPrice.txt Delete new line \n from the list in file Define dictionaries for…
Q: a. The mean of a list of numbers is its arithmetic average. The median of a list is its middle value…
A: Mean or arithmetic average: The mean of n- values is to sum of all the n -values and divide the sum…
Q: random value from 1-50. Display those values on the screen (as shown below), and then get an integer…
A: print("Part2:")list_1= list(map(int,input("List:").strip().split()))[:10]input1=int(input("Value to…
Q: Write a For Each loop that displays every element of an array named strSongNames in a ListBox named…
A: Java is a programming language. It contains extensive libraries (package). It can be used to create…
Q: If you have downloaded the source code from this book’s companion Web site, you will find a file…
A: Code: f = open('USPopulation.txt', 'r') data = f.readlines() max_diff = float('-inf')min_diff =…
Q: For any element in keysList with a value greater than 100, print the corresponding value in…
A: Introduction: The key list items are 42, 105, 101, and 100. And the supplied items list components…
Q: For any element in keysList with a value greater than 100, print the corresponding value in…
A: The given elements of keysList is {42, 105, 101, 100}And the given elements of itemsList is {10, 20,…
Q: Return the index of the first integer in items that is less than its index, or -1 if no such integer…
A: Q. def small_index(items: list[int]) -> int:"""Return the index of the first integer in items…
Q: static List findWinners(String pattern, int minLength, boolean even, Stream stream) This function…
A: Answer:
Q: A teacher stores the most recent quiz scores for her class in the list scores. The first element in…
A: GIVEN: A teacher stores the most recent quiz scores for her class in the list scores. The first…
Q: #include using namespace std; main(){ 宋** int row, col; fortrow=5; row>0; row--X 不 不米* for(col=row;…
A: here, we have to code them and screenshot the output. Here, to get the exact output, we have to…
Q: Question: Find the second largest number Code below: public static int findSecondLargest(List…
A: The question is to write the complete function for the given problem.
Q: Here are the contents for a movie: Lab 27 Home Alone Jeff Nunn 1990 Here are the contents for a…
A: According to the question We have to write code for the following question: Sample code and output…
Q: Expand positive integer intervals def expand_intervals(intervals): An interval of consecutive…
A: split() will split a string to list based on the given delimiter len() will be used to find the…
Q: Write a program that animates the linear search algorithm. Create a list that consists of 20…
A: Program Plan: • Create a window, set its title. • Create a canvas and add it to window. • Create and…
Q: listLine = The value of size after this code is executed is 4 listLine = line.split("***") size =…
A:
Q: The mean of a list of numbers is its arithmetic average. The median of a list is its middle value…
A: Start enter 9 number by defining median `calculate median calculate mean and print it
Q: 3. CHARGE ACCOUNT VALIDATION In the Chap07 folder of the Student Sample Programs, you will find a…
A: Charge account validation.
Q: The Humane Society’s goal is to find adoptive homes for each of the animals in their care. Design a…
A: lst=[]week=0tot=0num = int(input('How many days: '))for n in range(num): n = int(input('Enter…
Q: Write a For Next loop that adds the following set of values to the list box IstValues. 0,5,10,15,…
A: SUMMARY: -Hence, we discussed all the points.
Q: package datastructure; public class UseArrayList { public static void main(String[] args) { /* *…
A: Task : Create the array list. Show different array list functions. Use for loop to show array…
Q: partNames is a String array containing 100 elements. Write a for loop (standard for loop, not…
A: Print array of string using for loop . Python code
Q: Lab Goal : This lab was designed to teach you how to use a while loop. Lab Description (JAVA…
A: According to the information given:- we have to learn the working of while loop. Remove all…
Q: POEM_LINE = str POEM = List[POEM_LINE] PHONEMES = Tuple[str] PRONUNCIATION_DICT = Dict[str,…
A: Task : The task is to check all rhymes : given in the poem lines at given indexes.
Q: The attached file USPopulation,txt contains the US population in thousands, during the years 1950…
A: Pseudocode: Initiate the Main function Declare variables we are gonna use and initiate the list.…
Q: 7. World Series Winners In this chapter's source code folder (available on the Computer Science…
A: Step 1 : Start Step 2 : Open the WorldSeriesWinners.txt file in read mode. Step 3 : Declaring the…
Q: The mean of a list of numbers is its arithmetic average. The median of a list is its middle value…
A: In the above code, it has been asked to print the mean and median of the 9 numbers, in the following…
1994 Weekly Gas Graph
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.) Using matplotlib, write a Python
contents of the file then plots the data as either a line graph or a bar chart. Be sure to display
meaningful labels along the X and Y axes, as well as the tick marks.
(in python)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- JAVA INTRO Create a program that generates a report that displays a list of students, classes they are enrolled in and the professor who teaches the class. There are 3 files that provide the input data: 1. FinalRoster.txt List of students and professors ( The first value of each row indicates if it is a student or professor; S means a student , P means a professor) Student and Professor have different data Student row: "S",Student Name, StudentID Professor row: "P", Professor Name, Professor ID, Highest Education 2. FinalClassList.txt List of classes and professor who teach them Each row contains the following information: ClassID, ClassName, ID of Professor who teach that class The professor ID in this file matches the Professor ID in FinalRoster.txt. 3. FinalStudentClassList.txt List of classes the students are enrolled in. (StudentID, ClassID) Student ID matches Student ID in FinalRoster.txt and ClassID matches Class ID in FinalClassList.txt The output shall be…7. World Series Winners In this chapter's source code folder (available on the Computer Science Portal at www. pearsonhighered.com/gaddis), you will find a text file named WorldSeriesWinners. txt. This file contains a chronological list of the World Series' winning teams from 1903 through 2009. The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2009. (Note the World Series was not played in 1904 or 1994. There are entries in the file indicating this.) Write a program that reads this file and creates a dictionary in which the keys are the names of the teams, and each key's associated value is the number of times the team has won the World Series. The program should also create a dictionary in which the keys are the years, and each key's associated value is the name of the team that won that year. The program should prompt the user for a year in the range of 1903 through 2009. It should then display the name of the…Assignment 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…
- Assignment 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…Python Turtle Graphics Draw a spiral diagram using Python turtle package program follows 3 steps: Import the turtle module Create a turtle to control. Draw around using the turtle methods. You should consider the following points in your solution: The shapes should be drawn with the shown colors Yellow and white for the square-like shapes. Blue for the background. The prompt should have a turtle shape. The number of iterations should be 300 You should use only one loop. The number of the yellow color lines should be 200. The final shape of the output should be as shown in the picture attached. Make sure to set properly the starting position (x & y) of your drawing, to maintain the required diagram. video on youtube: https://www.youtube.com/watch?v=ZqoJD2RMu1IArrays Exercise Visual Basics: Write code that includes a Sub Procedure that includes an array initialized with integers, statements that print the total number of integers in the array, the sum of all integers in the array, and a For Each loop that prints the elements of the array. Include another For Each loop that add the elements of the array to a listbox.
- Cargo Container Report. You will be producing a program which will allow the user to generate the container report on the following page in Container Number order or Ship Name order. The program will also the user to lookup the data for any given Container by number. The % cargo weight is the percentage of the cargo of the gross weight (cargo weight/gross weight), % total is the percentage of the cargo for that container of the total amount of cargo unloaded (cargo weight for the container / total cargo unloaded. Hint: you are expected to use methods for your calculations. The accompanying file has the data for the containers unloaded today. The data includes container number int ship name. String tare weight of the container (empty weight) int the gross weight (container plus the cargo). Int You will need to computer the cargo weight as the gross weight minus the tare weight. If you have issues reading the data with the String, you may remove the String. However, you will lose points.…Write a For Each loop that displays every element of an array named strSongNames in a ListBox named lstDisplay. The loop variable is named strPlay.Geometric Progression Printer As you might recall, a Geometric Progression (or GP) is a sequence of elements in which the next number in the sequence is obtained by multiplying the previous number by the common ratio. The next number in the sequence is obtained by using this formula: a_na_1* r(n-1) While the sum of all numbers in the sequence is obtained using any of these formulae: If r 1, sum = a* n If r != 1 and r> 1, sum= a[(r¹-1)/(r - 1)] If r != 1 and r < 1, sum = a[(1 - r¹)/(1-r)] where a n = next number in the sequence, a_1 = first number in the sequence, r = common ratio, n = number of terms Your task is to write a Python program that 1. Accepts the necessary inputs from the user, i.e., start value (a_1), common ratio (r), and number of generate to generate (n). 2. Generates the Geometric Progression (GP) sequence starting from a_1 to n. 3. Prints out the GP HORIZONTALLY not VERTICALLY, e.g. 3, 9, 27, 81, 243, 729 .... 4. Calculates the sum of all numbers in the GP sequence 5.…
- PROGRAMMING PROBLEM The inventory of a shoe store lists shoes by stock number. With each stock number, there is associated a style number in the range of 0 to 50, the number of pairs in each size (sizes range from 3 to 14) and a price. A program is to be written to keep track of the inventory. The user is given the following choices: enter a new record, display a record, change the price of the stock item, or change the number on hand. When specifying a record the user may give either the stock number, or the style number. The array index can be used as a stock number. If the user decides to change the stock on hand, the program should ask which sizes will have their stock on hand changed. The program should be designed to run indefinitely, keeping track of changed in stock.C++ language Write a program that asks the user to enter daily sale for five stores and record them in an array.The program should then display a bar graph comparing each store’s sales for all days of a week.Create each bar in the bar graph by displaying a row of asterisks. Each asterisk should representRs.1000 of sales. The program also calculates the total sale each day, and total sale of the week.Here is an example of the program s output.Enter day 1 sales for store 1: 4000 [Enter]Enter day 1 sales for store 2: 6000 [Enter]Enter day 1 sales for store 3: 10000 [Enter]Enter day 1 sales for store 4: 11000 [Enter] Enter day 1 sales for store 5: 3000 [Enter]Enter day 2 sales for store 1: 9000 [Enter]Enter day 2 sales for store 2: 8000 [Enter]Enter day 2 sales for store 3: 19000 [Enter]Enter day 2 sales for store 4: 7000 [Enter]Enter day 2 sales for store 5: 9000 [Enter]…(and so on.)Weekly SaleMonday: Total Sale: 34,000/-Store 1: **** (4000)Store 2: ****** (6000)Store 3: **********…Programming 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.