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 reads a text file called student.txt.-
The input text file contains student_ID, student_name, Quiz_grade as well as Test_grade for each student.
-
Your program should read each student details from the file
-
Then calculate the average of Quizzes and Tests marks
-
Display the students’ details: Total number of students, total average, the total highest and
lowest marks.
-
The program should output the report into a file called output.txt.
-
A sample of output text file is given below.
-
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 2 steps with 4 images
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
how to create the student.txt file?
Solution
by Bartleby Expert
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
how to create the student.txt file?
Solution
by Bartleby Expert
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
- Design an application for the ABC Company that will process inventory from a file called ABC_Inventory.txt (attached to this assignment). The file contains Item ID, Description and list price stored on a separate line in the file. The program should display the contents of each record and then calculate and display the average list price. it is important that this is done in Thonny for python warrow_forwardIn Python, Create a program that will write 100 integers created randomly in a file. The integers will be separated by a space in the file. Read the data back from the file, and display the sorted data. The program should prompt the user to enter a file name. Utilize the following function headers for this problem: Main() WriteNumbers(filename) ReadNumbers(filename) The main function will first prompt the user to enter the filename. Then the main function calls WriteNumbers-then ReadNumbers. The WriteNumbers function opens an output file and writes 100 random numbers as long a large string text. Do not use lists for this problem- please just write a random number followed by a space 100 times. The ReadNumbers function will then read the text file and display the numbers sorted. In order to sort the numbers, read the big string and then split it into a list. Now convert them into integers by using list comprehension and then sort the list. Loop through the list and print each…arrow_forwardPython Write a program that requests five grades as input. Your program should drop the lowest two grades. It should then display the range and average of the remaining three grades. Your program should use a function that returns two values. Name your file: grades.pyarrow_forward
- step 1: Write a python program that will ask the user for their grocery list, one item at a time, and will write it to a file called groceries.txt. The program should create a new file called groceries.txt that will contain all of the user’s groceries when opened. Step 2: Modify the python program that creates a groceries.txt file so that if the user’s favourite fruit is not on the list, the program will append it to the end of groceries.txt file.arrow_forwardDesign a modular program in Python to process payroll for all hourly paid employees, save all the data into a text file and make a backup file as well. The program should allow user enter each employee's ID, name, hours worked, and hourly pay rate. And then calculate gross pay with overtime hours(hours beyond 40) paid 50% more. And then the program should display pay statement for each employee and store them into a same text file. The program should display total number of employees, total number of hours worked by all employees, and total gross pay and save them at the end of the same text file as well. The program should contain the following functions: main(), get_employee_info(), calc_gross_pay(hours, rate), display_pay_statement(emp_id, emp_name, hours_horked, hourly_pay_rate, gross_pay), save_pay_statement_to_file(file_object, emp_id, emp_name, hours_worked, hourly_pay_rate, gross_pay), save_summary_to_file(file_object, number_of_employees, total_hours_worked, total_gross_pay).…arrow_forwardThe Springfork Amateur Golf Club has a tournament every weekend. The club president has asked you to write a program that will read each player's name and score as keyboard input, and then save these as records in a file named golf.txt . First, the program should ask the user for the number of players. Then, it should ask the user for each name and score individually. The file golf.txt should be structured so that there is a line with the player's name, followed by their score on the next line. Here is an example: Emily 30 Mike 20 Jonathan 23 Look carefully at the following sample run of the program. In particular, notice the wording of the messages and the placement of spaces and colons. Your program's output must match this. Sample Run (User input shown in bold) Enter number of players :4↵ Enter name of player number 1 : Jimmy↵ Enter score of player number 1 : 30↵ Enter name of player number 2 : Carly↵ Enter score…arrow_forward
- 9b_act2. Please help me answer this in python programming.arrow_forwardGiven a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate lists, and outputs the available food items in the following format: name (category) - description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character ('\t'). Ex: If the input of the program is: food.txt and the contents of food.txt are: Classic ham sandwich Available sandwich Chicken salad sandwich Not available Classic cheeseburger Cheeseburger Not available Salads Water 16oz bottled water Available Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Beverages Beverages Mexican food…arrow_forwardSuppose that the file named Gradedata.txt in disk D:\ contains the following data about student : The student name, four grades, and the year of birth respectively (for example :Ahmad 90 80 66 80 2002). Your program should read the name of the student, the four grades, and the year of birth from the file, then calculate the average, and then print the student name, grades, and average on the computer screen. The program should also find the age of the student and whether his/her year of birth is a leap year or not and print that on the screen. »arrow_forward
arrow_back_ios
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