World Series Champions
If you have downloaded this book’s source code (the companion Web sire is available at www.pearsonhighered.com/gaddis), you will find a file named WorldSeriesWinners.txt. This file contains a chronological list of the winning teams in the World Series 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 that the World Series was not played in 1904 and 1994, so those years are skipped in the file.)
Write a program that lets the user enter the name of a team, and then displays the number of times that team has won the World Series in the time period from 1903 through 2009.
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
Database Concepts (8th Edition)
Elementary Surveying: An Introduction To Geomatics (15th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Starting Out With Visual Basic (8th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
- 1. The timeclock.txt file contains the hours worked data for every employee as well as the shift they worked. The layout for the file is as follows: EMPLOYEE NUMBER, HOURS WORKED, SHIFT 2. The personnel.txt file contains the names of all employees and their hourly pay rates. The layout for the file is as follows: EMPLOYEE NUMBER, EMPLOYEE NAME, PAY RATE Note: Both the timeclock.txt and payroll.txt files are pre-sorted by EMPLOYEE NUMBER in ascending order. Business Rules 1. For hours <= 40, the employee gross pay is: HOURS WORKED PAY RATE 2. For hours> 40, the employee gross pay is: HOURS WORKED PAY RATE 1.5 3. For shift 3, add $1 per hour to the employee pay rate The program should: 1. Download both input files in the same folder that you will create your .py program. 2. Read both input files together. 3. Match the input files by the EMPLOYEE NUMBER. 4. For each record in the timesheet.txt file, write a record in a new output file named payroll,txt based on the business rules…arrow_forwardFinish this program from the code posted below! Note: There should be two files Main.py and Contact.py You will implement the edit_contact function. In the function, do the following: Ask the user to enter the name of the contact they want to edit. If the contact exists, in a loop, give them the following choices Remove one of the phone numbers from that Contact. Add a phone number to that Contact. Change that Contact's email address. Change that Contact's name (if they do this, you will have to remove the key/value pair from the dictionary and re-add it, since the key is the contact’s name. Use the dictionary's pop method for this!) Stop editing the Contact Once the user is finished making changes to the Contact, the function should return. Code:from Contact import Contactimport pickledef load_contacts():""" Unpickle the data on mydata.dat and save it to a dictionaryReturn an empty dictionary if the file doesn't exist """try:with open("mydata.dat", 'rb') as file:return…arrow_forward#Data is given in the order: Serial Number | Item Name | Quantity | Priceprice_list = [["01","Keyboard",4,200.0],["02","Mouse",4,150.0],["03","Printer",2,300.0]] #Write Code to increase the price of all the items by 50 taka #Code1 #Write code to add a new item to the list using user input #Code2 print()#Print the list using nested loops #Code3 #Sample output given below: Enter Serial: 05Enter Item Name: MonitorEnter Quantity: 200Enter Price: 50 01Keyboard4250.0-----------------02Mouse4200.0-----------------03Printer2350.0-----------------05Monitor20050-----------------arrow_forward
- The file winning_numbers.txt contains the winning numbers for the Powerball lottery since the beginning of the year. Below is a partial listing of the file winning_numbers.txt: Drawing Date Winning Numbers Prize 1/1/2022 6 12 39 48 50 7 2 500000000 1/3/2022 2 13 32 33 48 22 2 540000000 1/5/2022 6 14 25 33 46 17 2 630000000 1/8/2022 20 21 36 60 65 13 10 20000000 1/10/2022 14 17 18 21 27 9 2 27000000 1/12/2022 12 21 22 30 33 24 4 38000000 1/15/2022 3 18 37 51 59 13 2 48000000 1/17/2022 9 24 35 46 65 22 2 53000000 1/19/2022 11 15 43 55 61 10 3 62000000 1/22/2022 8 14 33 36 67 17 2 76000000 The winning numbers for the date 1/1/2022 are: 6 12 39 48 50 7 2 The numbers 6 12 39 48 50 are considered the 5 white balls (ping pong balls with numbers on them), 7 is considered the Powerball (color is a red ping pong ball with a number on it), and 2 is considered the Powerball Multiplier. A player of the game wants to know which white balls have been selected with the greatest frequency and which…arrow_forwardYou are given a file called detention.txt with a list of students names and ID numbers. The data will be stored as shown below: Erin Shaw,36425109 Aldo Montes,8736542 Jessica,587963 Logan,22587 Leo Alvera,6544836 etc... Note that not all the students will have their last names in the detention.txt (names will not repeat in the file) Your job is to create a c++ program for teachers to look up a students name and display their student ID. Example output. (Input is highlighted) Welcome Staff! Please enter a student's name: Leo Alvera Searching for Leo Alvera... We found the Student ID: 6544836 for Leo Alvera Please enter a student's name: Jessica Alvera Searching for Jessica Alvera... Jessica Alvera not in detention.txt system Please enter a student's name: Please give proper explanation and typed answer only.arrow_forwardQ.Create an interesting educational information chat box that asks the user to give an input question and then answers the question given by user with a suitable answer. You can make use of list for different questions and answers.Save two to three answers for a single question and then for random selection of elements from those answers use random choice(list) method from random module that returns a random element. Also for a user question that doesn't matches with the questions present in the chat box it should display statement like "oops i can't answer that" "sorry i am not intelligent enough" "could u please ask something else" using random method so that every time one of these statements appear **coding language python ***try using basic programming techniques in python without using arrays and pointers * * * copy paste the program itself and also the screenshot of program and output * * * use any type of data for questions such as name details of cities species etc depends on…arrow_forward
- The above screen is used to browse the products table it uses the ProductDAO.java file, it calls the getProductByCriteria() function which should accept a parameter, this parameter should be the criteria that would be built from the two combo boxes and the text box, and queries the products table.The getProductByCriteria() function should return a list of Product objects that matches the criteria specified. Modify the function so that it accepts a string paramater consisting of the fields from the combo boxes and a price number from the text box separated by commas and use this string to modify the query in the function to return the desired result set. public List<Product> getProductByCriteria() //MAKE MODIFICATIONS TO THIS FUNCTION SO IT CAN TAKE PARAMETER(S) { if (openConnection()) { try{ List<Product> items = new ArrayList <> (); Product temp = null; String…arrow_forwardThe attached file USPopulation,txt contains the US population in thousands, during the years 1950 through 1990. The first line in the file contains the population for 1950, the second line contains the population for 1951, and so forth. Write a program that reads the file's contents into a list. The program should display the following data: the average annual growth in population during the time period the year with the greatest increase in population during the time period (highest growth rate) the year with the smallest increase in population during the time period (smallest growth rate) 151868 153982 156393 158956 161884 165069 168088 171187 174149 177135 179979 182992 185771 188483 191141 193526 195576 197457 199399 201385 203984 206827 209284 211357 213342 215465 217563 219760 222095 224567 227225 229466 231664 233792 235825 237924 240133 242289 244499 246819 249623arrow_forwardCargo 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.…arrow_forward
- The attached file, CommonFemaleNames.txt, contains the top 1000 female names in the United States. The format is integer string where the integer is the popularity number (1 is most popular) and string is a female first name. The program is to read the list of names and create an array of objects. It then sorts the array in alphabetical order. The user enters a name, which the program searches for and then reports how common that name is. The program is to use two different search algorithms, a linear search and a binary search. It reports on how many microseconds it takes to find the name using each method. Requirements 1. Each name and popularity number must be stored in a separate object. 2. The names on the list are all uppercase, but the program must find the name even if it is entered in lower case. Do this by converting the entered name to all caps. 3. It must give an appropriate message if the name entered is not on the list. 4. Both a linear and a binary search are…arrow_forwardThe attached file, CommonFemaleNames.txt, contains the top 1000 female names in the United States. The format is integer string where the integer is the popularity number (1 is most popular) and string is a female first name. The program is to read the list of names and create an array of objects. It then sorts the array in alphabetical order. The user enters a name, which the program searches for and then reports how common that name is. The program is to use two different search algorithms, a linear search and a binary search. It reports on how many microseconds it takes to find the name using each method. Requirements 1. Each name and popularity number must be stored in a separate object. 2. The names on the list are all uppercase, but the program must find the name even if it is entered in lower case. Do this by converting the entered name to all caps. 3. It must give an appropriate message if the name entered is not on the list. 4. Both a linear and a binary search are…arrow_forwardCode in C++ language Included is an input file that contains data for every Superbowl MVP winner, their position, and the team for which they played.Here is a sample of the data in the file. I removed the top row to make importation easier. Import this file into a 2D string array with 55 rows and6 columns. Use two array indexes for first and last name. Superbowl Year Winner MVP PositionI 1967 Packers Bart Starr QBII 1968 Packers Bart Starr QBIII 1969 Jets Joe Namath QBIV 1970 Chiefs Len Dawson QBV 1971 Colts Chuck Howley LBVI 1972 Cowboys Roger Staubach QBVII 1973 Dolphins Jake Scott SVIII 1974 Dolphins Larry Csonka FBIX 1975 Steelers Franco Harris RBX 1976 Steelers Lynn Swann WRarrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L