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
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 prompts the user for a file name, then reads that file (assuming that its…
A: Hello Student, hope you are doing well, I will be trying my best to explain and fulfill your query.…
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 program that prompts the user for an input file name, reads all words from the input file,…
A: Program in C++: #include <iostream>#include <fstream>#include <cstdlib>#include…
Q: Write a Python program that reads from the user the name of two files (an input file and an output…
A: the code is an given below : ######################## PGM START ##################################…
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 Python program that reads each line of an input file temperatures.txt that consists of a…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Write a program that reads the student information from a comma separated values (csv) file. The…
A: Required:
Q: Create a program that calculates the average test scores. Given the student’s name and five test…
A: Problem Statement: Create a program that calculates the average test scores. The data is input from…
Q: Write a Python program that reads a list of strings from a file "strings.txt" (see Figure 1) and…
A: Python program is as follows:- def isPalindrome(word): if word == word[::-1]: return True…
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: Suppose you are given a text file named "Cars", in which each line of the file contains the model,…
A: Program :
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 program that removes all the occurrences of a specified string from a text file. For…
A: This program is done with java file operations. So initially reading the file arguments from the…
Q: Suppose you are given a text file "students.txt" that contains the data of students. Every line in…
A: the code is an given below : CODE- import java.io.File;import java.io.FileNotFoundException;import…
Q: Write a complete program that will write a file (named output.txt) that contains the integers from 1…
A: //Note not programming language is mentioned so i was used python f=open("output.txt","r")for i in…
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 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: 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 Python program that reads from the user the name of two files (an input file and an output…
A: code :-- # getting the input an output file name from user file_in = input('Enter input file name :…
Q: Write a program that reads in from a file a starting month name, an ending month name, and then the…
A: #include <iostream>#include <string>#include <fstream>#include…
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 calculate the sum and the average of random numbers which are written to a file…
A: (1)First we need to read the number random numbers to be generated (2)Now we generate the random…
Q: Write a Python program that reads each line of an input file called data.txt that consists of a…
A: Algorithm: Start Read the content of data.txt file and store the content in data Open sorted.txt…
Q: Write a program that removes all the occurrences of a specifiedstring from a text file. For example,…
A: A Java program is as follows, import java.io.*; import java.util.*; public class Exercise12_11 {…
Q: Suppose you are given a text file "students.txt" that contains the data of students. Every line in…
A: code is an given below : import java.io.*; import java.util.*; public class Main {…
Q: Write a Python program that reads each line of an input file temperatures.txt that consists of a…
A: inputfile=open('temperatures.txt','r') #Opening the temperatures.txt…
Q: Write a program that prompts the user for an input file name, reads all words from the input file,…
A: Create a objects of input and output file. Then read input file name Then open input file using…
Q: Write a program that reads in two hexadecimal numbers from a file, hex.txt, and prints out the sum…
A: //USAGE hexdump.py [filename] import sys import os.path def check_file_provided(): # This method…
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 that reads a file containing exactly 10 lines, each line contains exactly 10…
A: For the given question i have given python code with proper output below hope it will help you.
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 words from a text file and displays all the words (duplicates are not…
A: Please find the code below::: SortWords.java package fileIO; import java.io.File;import…
Q: Write a program that reads in from a file a starting month name, an ending month name, and then the…
A: code: #include <iostream>#include <fstream>using namespace std; int main(){//Declaring…
Q: Write a program that reads in from a file a starting month name, an ending month name, and then the…
A: GIVEN:
Q: For this task you are asked to write a program that will open a file called "story.txt" and count…
A: EXPLANATION: Used system call fopen,we have opened the file "file1.txt"in read mode System call…
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 that asks the user for a file containing a list of items to be completed and a name…
A: Please indent the code as shown in the screenshot below :
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
- Write a program that reads student information from a text file, then creates a text file that records the course grades of the students and a final grade. Each row of the .txt file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student, each separated by a space. A sample of the student information is provided in StudentInfo.txt below. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: • Read the file name of the .txt file from the user. • Open the .txt file and read the student information using readline() or readlines(). • Compute the average exam score of each student. • Assign a letter grade to each student based on the average exam score in the following scale: ◦ A: 90 =< x ◦ B: 80 =< x < 90 ◦ C: 70 =< x < 80 ◦ D: 60 =< x < 70 ◦ F: x < 60 • Output the first names, last names, exam scores, and letter…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 that reads in from a file a starting month name, anending month name, and then the monthly rainfall for each monthduring that period. As it does this, it should sum the rainfall amountsand 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 inchesand the average monthly rainfall was 1.83 inches.
- Write a program in Python that reads student information from a text file, then creates a text file that records the course grades of the students and a final grade. Each row of the .txt file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student, each separated by a space. A sample of the student information is provided in StudentInfo.txt below. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: • Read the file name of the .txt file from the user. • Open the .txt file and read the student information using readline() or readlines(). • Compute the average exam score of each student. • Assign a letter grade to each student based on the average exam score in the following scale: ◦ A: 90 =< x ◦ B: 80 =< x < 90 ◦ C: 70 =< x < 80 ◦ D: 60 =< x < 70 ◦ F: x < 60 • Output the first names, last names, exam scores, and letter grades of the students into a text file named…Write a program that opens a text file called quiz.txt for reading. This file contains a single linewith a student’s first name then one space, then the student’s last name, then one space, then somenumber of quiz scores that, if they exists, are separated by one space. The student will have betweenzero and ten scores (inclusive), and each score is an integer between 0 and 100 (inclusive). The filemay or may not end with a new line character. Your program will read the data from this file andwrite its output to a second file. The data in the output file (named average.txt) will contain thestudent’s quiz scores followed by the average of the student’s quiz scores.The output file must be formatted as described below.1. Each quiz score should be listed in a right-justified column that is 4 characters wide. Notethat if a student has fewer than 10 scores (they have missed one or more of the quizzes), yourprogram will need to display the missing score(s) using 0 for each one.2. The average…Write a Python program that reads from the user the name of two files (an input file and an output file). 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 beLine 1: Mary had a little lambLine 2: Whose fleece was white as snow Line 3: And everywhere that MaryLine 4: The lamb was sure to go
- Write a program that prompts the user for an input file name, reads all words from the input file, and writes the words to the output file named sentences.txt. Start a new line whenever a word ends in a period, question mark, or exclamation mark.Write a program that asks any number of students to enter their final grade and enables you to store these grades into a grades.txt plain text file. Then it reads the grades from the grades.txt file, and displays the individual grades and their count and average.Write a program that receives a coded message file(Lab3ExtraCreditCT.txt) from your local espionage agent and decodes it into a file using standard English. The problem is your agent forgot to tell you the key used to decode the message. Fortunately, this is a simple substitution code consistently using 1 alphanumeric character to represent another, this is case sensitive. All other characters are not substituted, so a space will always be a space, a – will always be a –, a @ will always be a @, etcetera. You may use the following table to help you, it contains the most common letters used in the English language in descending order. E A R I O T N S L C U D P M H G B F Y W K V X Z J Q 0 5 3 2 4 6 8 1 9 7 Using the following key to convert plaintext to coded text: Plaintext = Now is the time for all good men to come to the aid of their country. Key = THEQUICKBROWNFXJMPSVLAZYDG The file your program outputs should look like this: Coded Text = Fxz bs vku vbnu ixp tww…
- Write a program that reads a student's name followed by five test scores. The program should output the student's name, the five test scores, and the average test score. Output the average test score with two decimal places. The data to be read is stored in a file called test.txt. The output should be stored in a file called testavg.txt. test.txt: A file containing the student names and the five test scores for every student. Andrew Miller 87.50 89 65.75 37 98.50 Green Sheila 91.05 75.88 50.0 65.5 74.30 Sethi Amit 49.82 75 30 74 86.30 testavg.txt: A file containing the student name, the five test scores, and the average of the five test scores for each student.Write a program that reads data from a file containing integers that ends with -999. Output the numbers that are divisible by 7 Output the numbers that are divisible by 11 Output the numbers that are not divisible by 7 or 11Write a program that reads a text file named as “input.txt” and performs the following operations:1. Write each word in the text file in reverse order to the file named as“output.txt” . (Example: If the text file contains ”Hello World!”, then itshould write to the output file ”olleH dlroW!”)2. Print the number of words.3. Print the number of words starting with a capital letter.4. Print the number of words that contain no characters other than Englishletters.In this challenge you are supposed to:1. Comment every function with a description explaining what it does andhow it does it.2. Research and learn how to read and write into text files by using properlibrary functions in C.In your program, you can assume that1. Both the input file (input.txt) and the output file (output.txt) will beplaced on the same folder as your program’s executable (.exe).2. In the input file, the length of the words will be at most 100.