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
Question
- Create a folder named lastnameCh6Sum where the last name is your last name. Example: summersCh6Sum
- Inside your new folder place a copy of the attached numbers.txt file I have attached below.
- Write the following python
program and save it in your new folder - This program must open up the numbers.txt file, read all the numbers in the file, calculate their total, output the sum to a new file named sum.txt as well as display the sum to the screen.
- Make sure to display a message to the user before you print the sum to the screen that lets the user know that the sum has been calculated and saved in the sum.txt file. Also display the total on the screen.
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 5 steps with 3 images
Knowledge Booster
Similar questions
- 4act3 Please help me solve this python programming. There are two parts to this problem. Include screenshots of your code for better understanding :)arrow_forwardCreate an inputfile named "inputFile.txt" (use "Note Pad") that contains the following data. Be sure that the last line of the file is empty (i.e., not even a space character). In other words, after entering the second line of data, press the <ENTER> key, save the file, then exit the editor. 5 10 6 923 7 13 40 Implement the following algorithm Create & Open inputFileCreate & Open outputFileRead first line of data into variables a, b, c, dDOWHILE !EOF Create a unique formula that uses the variables a, b, c, & d. For example, value = (a*a) + b - c + d Output value into outputFile Read each line of data into variables a, b, c, dENDDOClose inputFileClose outputFile Post the source code (embed the code in your response; DO NOT ATTACH THE C++ FILE).arrow_forwardDAT6 The only allowed external libraries/functions are: stdio.h: > printf() > scanf() Please use Visual Studio Code and C programming language.arrow_forward
- create a Python program that: Opens a file and reads the contents of the following file trips.txtDownload trips.txt The file contains several lines of data, with each data item separated by commas. The data is: A trip date The amount of fuel used on the trip The number of miles traveled on the trip For each of the lines of data in the file, separate the data items and put them in appropriate variables The file contents are in the form of strings, so you must convert the numbers in the data into the proper type Create a function that calculates the fuel mileage achieved on each trip Pass the appropriate data to this function Place this function in a separate module Call the function as needed and have the function return the calculated fuel mileage Create a function that displays the following items on a single line, and place the function in the same module as the previous function. Pass the appropriate data to this function Trip data Amount of fuel used Numbers of…arrow_forward>> classicVinyls.cpp For the following program, you will use the text file called “vinyls.txt” attached to this assignment. The file stores information about a collection of classic vinyls. The records in the file are like the ones on the following sample: Led_Zeppelin Led_Zeppelin 1969 1000.00 The_Prettiest_Star David_Bowie 1973 2000.00 Speedway Elvis_Presley 1968 5000.00 Spirit_in_the_Night Bruce_Springsteen 1973 5000.00 … Write a declaration for a structure named vinylRec that is to be used to store the records for the classic collection system. The fields in the record should include a title (string), an artist (string), the yearReleased (int), and an estimatedPrice(double). Create the following…arrow_forward@.arrow_forward
- Write the program FileComparison that compares two files. Two files have been provided for you, Quote.txt and Quote.docx, both containing movie quotes and are located in the /root/sandbox/ directory Note: you will not be able to see the Quote.docx file. Next write the file comparison application that displays the sizes of the two files as well as the ratio of their sizes to each other. To discover a file’s size, you can create a System.IO.FileInfo object using statements such as the following, where FILE_NAME is a string that contains the name of the file, and size has been declared as an integer: FileInfo fileInfo = new FileInfo(FILE_NAME); size = fileInfo.Length; Your program's output should look like the following: The size of the Word file is FILE_SIZE and the size of the Notepad file is FILE_SIZE The Notepad file is x% of the size of the Word file using System; using static System.Console; using System.IO; class FileComparison { static void Main() { // Getting…arrow_forwardI need Answer Quicklyarrow_forwardCreates a sales receipt, displays the receipt entries and totals, and saves the receipt entries to a file .Prompt the user to enter the - Item Name Item Quantity Item Price Display the item name, the quantity, and item price, and the extended price (Item Quantity multiplied by Item Price) after the entry is made Save the item name, quantity, item price, and extended price to a file When you create the file, prompt the user for the name they want to give the file Separate the items saved with commas Each entry should be on a separate line in the text file Ask the user if they have more items to enter Once the user has finished entering items Close the file with the items entered Display the sales total If the sales total is more than $100 Calculate and display a 10% discount Calculate and display the sales tax using 8% as the sales tax rate The sales tax should be calculated on the sales total after the discount Display the total for the sales receiptarrow_forward
- Open the project or solution named mpg in this folder: ex_starts\ch07_ex1_mpg Review the code and run the program to refresh your memory on how it works. Notice that, unlike the program in this chapter, this program lets the user perform more than one calculation, it stores the values the user enters in a text file, and it displays the total miles, total gallons, and average miles per gallon when the program starts and after each entry. Add a function that calculates the miles per gallon Define a function named calculate_mpg() before the main() function that calculates the miles per gallon. This function should accept two double values for the miles and gallons, round the result to two decimal places, and return the result as a double type. Modify the code in the main() function so it uses the calculate_mpg() function. Note that the miles per gallon is calculated in three different places. Move the definition for the calculate_mpg() function after the main() function. When you run…arrow_forwardPython Soulution to 1arrow_forwardUsing Java PrintWriter, write a program that prompts the user for information and saves it to a text file File name is musicians.txt Use this information below: George,Thoroughgood,54321 Ludwig,Van Beethoven,90111 Edward,Van Halen,12345arrow_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