Write a Python program that reads each line of an input file temperatures.txt that consists of a town name followed by a set of temperatures. The program will then calculate the maximum, minimum, and average temperature and save them in a file called tempSummary.txt. For example, if the temperatures.txt contains Muscat 25 35 30 40 30 Suhar 20 30 25 25 Salalah 35 45 40 15 16 18 The file tempSummary.txt will contain
Q: Write a program countfile.c that calculates and prints on screen the number of bytes or number of…
A: The main objective of the given problem is to take input from the command prompt. The arguments…
Q: Write a program that allows the user to create and maintain a list of contacts in a file named…
A: Answer: I have done code in C++ . and also I have attached code as well as code screenshot.
Q: Write a program which reads a line of text and stores it in a file. Read the text from the file and…
A: Given: Various String Operation In File
Q: Write a complete program that will write a file (named output.txt) that contains the integers from 1…
A: #note no programming language is mentioned so i was used python f=open("output.txt","r")for i in f:…
Q: Write a python program that will ask the user for their grocery list, one item at a time, and will…
A: here in given question ask for write program in python as per question staatement.
Q: Write a Python program that reads from each line of an input file called grades.txt, a student id…
A: Actually, python is a easiest programming language. It is a dynamically typed language.
Q: Write a program countfile.c that calculates and prints on screen the number of bytes or number of…
A: Program in C language. Implementing the command line argument Using file pointer. Declared a…
Q: Write a Program that reads integers from a file called "input.dat" (Figure 1) that contains unknown…
A: As no programming language is mentioned, it is solved using basic C++
Q: Write a program that reads the student information from a comma separated values (csv) file. The…
A: Required:
Q: xt file of names, (3 names per line, 5 lines in total) followed by an age for each name. Go through…
A: input.txt Smith 25 kevin 65 Hank 54Tom 98 Ben 96 Denver 63John 52 Gandia 63 Tokeyo 29Lebaon 36…
Q: Write a program, reading the temperature data from an input file, translating them to another…
A: Below is the required code in java and sample output:
Q: Write a program that inputs a text file. The program should print the unique words in the file in…
A: NOTE : As the question is not specific about the programming language to be used to write the code ,…
Q: Write a Python program that reads each line of an input file temperatures.txt that consists of a…
A: Algorithm : Step 1 : opening the file temperature.txt in read mode and tempSummary.txt in write…
Q: Create a Python program that reads a text file containing 10 mailing addresses. The text file of…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Write a program countfile.c that calculates and prints on screen the number of bytes or number of…
A: Step 1: Get the file name and option from the command line. Step 2: Open the file in read mode using…
Q: Thirukkural is a popular literary work in Tamil. It consists of 1330 verses, each verse having 2…
A: # Apply same idea if you want in other programming language import mathdef main(): # get the input…
Q: Write a java program to read from the Keyboard name of the item and its price until the user Enter…
A: Step 1 : Start Step 2 : In the main method , declare the array of strings to store the item names…
Q: Write a program that reads in two hexadecimal numbers from a file, hex.txt, and prints out the sum…
A: Here, I'm writing C++ code:- #include<iostream>#include <fstream>using namespace…
Q: Write a complete python program with a main function that reads from a file called numbers.txt and…
A: The main objective of the python program,main.py is to read a file that contains the two numbers on…
Q: Write a program that reads a text file named as "input.txt" and performs the following operations:…
A: The ask is to write a C program to do the following: - read a file named input.txt - read the input…
Q: Write a computer program that calculates the bullet train’s constant rate of acceleration, given an…
A: Code: import java.io.File;import java.io.FileWriter;import java.io.IOException;import…
Q: Write a python program that reads from a text file whose name is provided by the user (see a sample…
A: Program code: #input of filenamefilename = input("Enter input filename: ") try: # open the file in…
Q: Write a Python program that reads student-csv.py file and find each student average. For example,…
A: To create student-csv.py we need to shape the below data : - Joe;80;73;88;90;60;75;72…
Q: Suppose you are given a text file named "Results.txt", in which each line contains a course code,…
A: import java.util.Scanner;import java.io.*; public class Student123{ public static void main(String…
Q: Write a program called alice_words.py that creates a text file named alice_words.txt containing an…
A: Python code to count no of occurrence of each word import string text = open("alice_words.txt",…
Q: Write a Python program sentences.py that prompts for multiple sentences. The program should write…
A: Python Reverse each word in a sentence
Q: Write a program that asks any number of students to enter their final grade and enables you to store…
A: I have provided PYTHON CODE along with TXT FILE SCREENSHOT, CODE SCREENSHOT and OUTPUT…
Q: Create a program that reads a text file containing a 15 x 15 grid which represents a block of human…
A: Java Source Code: import java.util.ArrayList;import java.io.FileReader;import…
Q: Write a Python program that reads from each line of an input file called grades.txt, a student id…
A: Python code for Take three subject marks Return average with name or roll number.
Q: Write a program that reads in two hexadecimal numbers from a file, hex.txt, and prints out the sum…
A: #include<iostream>#include <fstream>using namespace std;bool…
Q: Write a program that reads a file consisting of students’ test scores in the range 0–200.…
A: Step 1 I am using c++ programming language for to execute this program.
Q: Write a Python program that calculates the area and the circumferenceof a circle whose radius is…
A: Required: Write a Python program that calculates the area and the circumferenceof a circle whose…
Q: Write a program that first reads in the name of an input file and then reads the file using the…
A: Write a program that first reads in the name of an input file and then reads the file using the…
Q: Write a Python program that reads each line of an input file workshop.txt that consists of a city…
A: Algorithm: Start Read workshop.txt file data Declare an empty string s Iterate through file content…
Q: Write a program that first reads in the name of an input file and then reads the input file using…
A: def read_file(filename): file = None # open file try: file = open(filename) except: print("Unable…
Q: from Big Java 6th. Edition. Ch.11 P11.12: the capacitor is represented by the equation…
A: PROGRAM: //Importing header file import java.io.*; import java.util.*; import…
Q: Write a program that produces a bar chart showing the population growth of Prairieville, a small…
A: Code: #include <iostream>#include <iomanip>#include <fstream>using namespace…
Q: Write a program that allows the user to create and maintain a list of contacts in a file named…
A: Actually, program is an executable software that runs on a computer.
Q: Write a program that will read names, ids, dept names, and cgpa of some students from a file and…
A:
Q: Write a program that reads in two hexadecimal numbers from a file, hex.txt, and prints out the sum…
A:
Q: Write a program countfile.c that calculates and prints on screen the number of bytes or number of…
A: C programming is a general-purpose, procedural, imperative computer programming language developed…
Q: Write a program that reads in from a file a starting month name, an ending month name, and then the…
A: GIVEN:
Q: Write a program called ReverseText.exe that takes two file names as command-line arguments. The…
A: In this C program, I have created a function that will read the first file and append the content…
Q: Write a program that reads in two hexadecimal numbers from a file, hex.txt, and prints out the sum…
A: Given data is shown below:
Q: Write a program in a single file that: Main: Creates 10 random doubles, all between 1 and 11, Calls…
A: Create an object for a file. Declare an array to store the random numbers of type double. Take a…
Q: Write a program countfile.c that calculates and prints on screen the number of bytes or number of…
A: The objective of the given problem is to take the input switch and file name from the user through…
Q: Write a program to do the following: - 1) Read the file Mydata.txt which includes unlimited number…
A:
Step by step
Solved in 2 steps with 2 images
- Write a program that reads student data from a file, compute their GPA and writes the results to a different file. 1. The user should have the option to either enter their text file that contains the student grades or use the provided text file that contains theinformation. The data in "indata.txt" should look similar to this, Lara_Croft75 70 91 69 89Chris_Redfield68 88 79 85 94Johnny_Cochran69 98 95 77 80Wanda_Maximoff84 86 98 95 92Luke_Skywalker74 96 80 98 97William_Kurt89 52 99 81 58Samuel_Jackson50 96 50 64 95END_OF_FILE This is supposed to be in python. This is what I have so far. I have no experience I apologise. I am trying to finish the GPA calculating program currently but am having trouble finishing it. grade = input("enter grades")points = 0 if grade is 90-99:total_points = 4.0if grade is 80-89:total_points = 3.0if grade is 70-79:total_points = 2.0if grade is 60-69:total_points = 1.0if grade is 50-59:total_points = 0.0gpa = total_points/len(grade)print(gpa,"is gpa")Write a program which reads the content of a file given as input and counts the number of thewords in the file. It is assumed the words are separated by one or multiple of the followingcharacters: ’ ’ ’,’ ’?’ ’!’ ’.’ ’\t’ ’\r’ ’\n’. input: words.txt output: The file contains 17 words. Please write in C programming language.Exercise 1:Write a Python program that reads from the user the name of two files (an input file and an outputfile). The program will then read each line of the input file and save it in the output file preceded with the line number and removing any of the following punctuations (. , ! ? ; :) found at the end of the line. For example, if the input file is: Mary had a little lamb;Whose fleece was white as snow;And everywhere that Mary went;The lamb was sure to go! Then the output file the content of the input file and saves it in the produced output file will be Line 1: Mary had a little lambLine 2: Whose fleece was white as snowLine 3: And everywhere that MaryLine 4: The lamb was sure to go
- For this program, assume you have an input file with several lines of text. Each line has a student's last name, followed by a space and then 4 numbers which represent his/her grades. Your program should read this input file and produce an output file with the same number of lines, each line showing the last name and the average of the student's scores. "grades.txt" is the file your program should read. "badformat.txt" is an example of a file that your program can't read, so a clear error message should be generated, as shown in the sample output. Your program must catch all exceptions. Your main method must NOT have a "throws" clause - it must catch all exceptions and dea' with them appropriately. Other methods may throw exceptions, as long as the main method catches them. I don't expect you to examine any filenames to make sure they're valid. Instead, you should use the filename the user gives you and try to open a file by that name. That will throw an exception if the filename is…in python Given a set of text files containing synonyms for different words, complete the main program to output the synonyms for a specific word. Each text file contains synonyms for the word specified in the file’s name, and each row within the file lists the word’s synonyms that begin with the same letter, separated by a space. The program reads a word and a letter from the user and opens the text file associated with the input word. The program then stores the contents of the text file into a dictionary predefined in the program. Finally the program searches the dictionary and outputs all the synonyms that begin with the input letter, one synonym per line, or a message if no synonyms that begin with the input letter are found. Hints: Use the first letter of a synonym as the key when storing the synonym into the dictionary. Assume all letters are in lowercase. Ex: If the input of the program is: educate c the program opens the file educate.txt, which contains: brainwash brief…in python: Given a set of text files containing synonyms for different words, complete the main program to output the synonyms for a specific word. Each text file contains synonyms for the word specified in the file’s name, and each row within the file lists the word’s synonyms that begin with the same letter, separated by a space. The program reads a word and a letter from the user and opens the text file associated with the input word. The program then stores the contents of the text file into a dictionary predefined in the program. Finally the program searches the dictionary and outputs all the synonyms that begin with the input letter, one synonym per line, or a message if no synonyms that begin with the input letter are found. Ex: If the input of the program is: educate a then the program outputs: No synonyms for educate begin with a.
- Write in Python: Given a set of text files containing synonyms for different words, complete the main program to output the synonyms for a specific word. Each text file contains synonyms for the word specified in the file’s name, and each row within the file lists the word’s synonyms that begin with the same letter, separated by a space. The program reads a word and a letter from the user and opens the text file associated with the input word. The program then stores the contents of the text file into a dictionary predefined in the program. Finally the program searches the dictionary and outputs all the synonyms that begin with the input letter, one synonym per line, or a message if no synonyms that begin with the input letter are found. Hints: Use the first letter of a synonym as the key when storing the synonym into the dictionary. Assume all letters are in lowercase. Ex: If the input of the program is: educate c the program opens the file educate.txt, which contains: brainwash brief…Write a program that will read in a file of student academic credit data and create a list of students on academic warning. The list of students on warning will be written to a file. Each line of the input file will contain the student name (a single String with no spaces), the number of semester hours earned (an integer), the total quality points earned (a double). The following shows part of a typical data file: Smith 27 83.7 Jones 21 28.35 Walker 96 182.4 Doe 60 150 The program should compute the GPA (grade point or quality point average) for each student (the total quality points divided by the number of semester hours) then write the student information to the output file if that student should be put on academic warning. A student will be on warning if he/she has a GPA less than 1.5 for students with fewer than 30 semester hours credit, 1.75 for students with fewer than 60 semester hours credit, and 2.0 for all other students. The file Warning.java contains a skeleton of the…Write a program that will read in a file of student academic credit data and create a list of students on academic warning. The list of students on warning will be written to a file. Each line of the input file will contain the student name (a single String with no spaces), the number of semester hours earned (an integer), the total quality points earned (a double). The following shows part of a typical data file: Smith 27 83.7 Jones 21 28.35 Walker 96 182.4 Doe 60 150 The program should compute the GPA (grade point or quality point average) for each student (the total quality points divided by the number of semester hours) then write the student information to the output file if that student should be put on academic warning. A student will be on warning if he/she has a GPA less than 1.5 for students with fewer than 30 semester hours credit, 1.75 for students with fewer than 60 semester hours credit, and 2.0 for all other students. The file Warning.java contains a skeleton of the…
- C++ text 284.12223.09579.12998.651237.84764.75395.65458.01670.353765.003842.10190.23335.35662.952719.253564.02193.23222.231457.2089.751323.65234.35789.89224.67663.95245.38 Write a program that reads from a text file named “sales.txt”, which contains the sales figures (double) of a store. Your program should: Display the average, the highest, and the lowest sales figures Remember to: Test the file open error Close the file at the end.Chapter 4. PC #6. File Letter Counter (page 264) Write a program that asks the user to enter the name of a file, and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the file. Class name: FileLetterCounter Hints: Hint 1. To read a single character from the keyboard, you need to read a full line and then take the first character in position 0. Hint 2. To count the occurrences of a given characters in a file you need to read the file line-by-line using a while loop, then for each line check all characters in all positions and increment the character counter for each occurrence. This will require to have a for-loop nested inside the while-loop. Here is a working code Please modify it so it passes the test cases because I run it it does not work: mport java.io.File;import java.io.FileNotFoundException;import java.util.Scanner;public class FileRead {public static void main(String[] args)…Chapter 4. PC #6. File Letter Counter (page 264) Write a program that asks the user to enter the name of a file, and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the file. Class name: FileLetterCounter Hints: Hint 1. To read a single character from the keyboard, you need to read a full line and then take the first character in position 0. Hint 2. To count the occurrences of a given characters in a file you need to read the file line-by-line using a while loop, then for each line check all characters in all positions and increment the character counter for each occurrence. This will require to have a for-loop nested inside the while-loop. Here is a working code Please modify it so it passes the test cases because I run it it does not work: Also I do not need Goodbye And I run it through hypergrade which it has all the test cases it does not work. mport java.io.File;import…