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 a python program that read a text file 'count.txt', and should count and display the occurrence of word that start with alphabet B or b.
The contents of 'count.txt' are given below:
A big Boy playing with blue Ball.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 3 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
- IN PYTHON: Decrypting with ascii I have a file called 'dict.txt'. This file contains over 50,000 english words. One word from this file is used as a key (we do not know which one of course). Some have capital letters. I have another file called 'decrypt.txt' which is a file containing a string of numbers i must decrypt using a key found in the 'dict.txt'. This 'decrypt.txt' file message has length of 300. My question is, since i do not know which word (from the file with the 50,000+ words) is the key I must use to decrypt the other file, how do I write a function that: loops through all possible keys from 'dict.txt' to find the one that decrypts my file 'decrypt.txt' best? Somehow i must count how many 'words' are actual words to determine which key is best and then print my final decrypted message.arrow_forwardWrite a python program that prompts the user for their favorite basketball team. It should be able to read the list of teams provided below in a file called favorite_teams.txt and check if their team is in that file. Teams in the file:JazzBullsMavericksSpursIf the team is in the file let the user know that their team is in the list of favorites. If the team is not in the file, add the team to the end of the file. Also, let the user know that their team will be added to the file.Sample Run in File:What is your favorite NBA team? Jazz [Enter]Your team Jazz is in the listFile before and after run: JazzBullsMavericksSpurs Sample Run not in File:What is your favorite NBA team? Pelicans [Enter]Your team Pelicans is not in the list. It will be added.File before run: JazzBullsMavericksSpursFile after run:JazzBullsMavericksSpursPelicansarrow_forwardFor this assignment, you will write a Python program that uses a file named scores.txt to store sets of bowling scores for different dates. scores.txt should store the data so that each line has a month, day, and the scores the user earned on that date. As an example, scores.txt might look something like this: January 15 200 300 126 200 250April 20 125 100 May 17 300 100 215 The very first time your program starts, scores.txt should not exist (i.e. create it with Python code the first time the program runs). In your main function, continuously give the user the following five options: Quit the program. View all Scores. If the user selects this option, call a function named view_scores. This function should print the scores in a nicely formatted manner. For example: "On January 15, you scored 200, 300, and 126", etc.. Add a Score. If the user selects this option, call a function named add_score. This function should ask the user for a month, day, and as many scores as they want to…arrow_forward
- Create a program that reads in a word from the user and counts the number of occurrences of that word in a file called words.txt. -- words.txt This is a file that contains many words. Yes it does have so many words. Many, many words. Well, maybe it is not that many after all. So, just how many is MANY? in c++ pleasearrow_forwardJava Your program must read a file called personin.txt. Each line of the file will be a person's name, the time they arrived at the professor's office, and the amount of time they want to meet with the professor. These entries will be sorted by the time the person arrived. Your program must then print out a schedule for the day, printing each person's arrival, and printing when each person goes in to meet with the professor. You need to print the events in order of the time they happen. In other words, your output will be sorted by the arrival times and the times the person goes into the professor's office. In your output you need to print out a schedule. In the schedule, new students go to the end of the line. Whenever the professor is free, the professor will either meet with the first person in line, or meet with the first person in line if nobody is waiting. Assume no two people arrive at the same time. You should solve this problem using a stack and a queue. You can only…arrow_forwardWrite a complete Python program that opens a file called sample.txt for reading, and opens a file called out.txt for writing.arrow_forward
- In Python, Use number.txt file (below). create a program that opens num.txt, a file consisting of a series of integers. Display all of the numbers in the file. num.txt 10 25 36 45 89 42 54 please write code as simply as you can. Please have good variables.arrow_forwardCan someone please help me with this project for my Java Programming class? If you could correct my mistakes for me that would be great.arrow_forwardWrite a program that reads in from a file a starting month name, an ending month name, and then the monthly rainfall for each month during that period. As it does this, it should sum the rainfall amounts and then report the total rainfall and average rainfall for the period. For example, the output might look like this: During the months of March-June, the total rainfall was 7.32 inches and the average monthly rainfall was 1.83 inches. Data for the program can be found in the rainfall.txt file located in the Chapter 5 º programs folder on the book's companion website. Hint: After reading in the month names, you will need to read in rain amounts until the EOF is reached and count how many pieces of rain data you read in.arrow_forward
- In Python.arrow_forwardWrite a Python program stored in a file q1.py that calculates what day of the week a certain date will be in a given month. The user will first start by entering the first day of the month (i.e. Monday) and then enter a number from 1 to 30. In this problem, we assume that all months have 30 days. The program will output what day the number corresponds to. Users can enter days by the first three letters of the day, the whole name for the day, or the single letter abbreviation (U-Sunday, M-Monday, T-Tuesday, W-Wednesday, R-Thursday, F-Friday, S-Saturday). Example: Enter the first day of the month: M Enter a date: 19 The 19th is a Friday.arrow_forwardIn Java: Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs yes if every character is a digit 0-9. Ex: If the input is: 1995 the output is: yes Ex: If the input is: 42,000 or 1995! the output is: no Hint: Use a loop and the Character.isDigit() function.arrow_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