1. The phone numbers collected from questionnaire is a mess. Design a regular expression to filter out those numbers that are stored in the standard format "+00-0-0000-0000" from the file called "Q1.txt" and redirect the results to the "cleaned.txt". +61392144979 +61 3 9214 4778 +61-3-9214-4980 +66(2)51574430 +61-3-9285-7706 Note: Only +61-3-9214-4980 and +61-3-9285-7706 are the valid results.
Q: A straight line can be defined by a pair of points pi(x1, yı) and p2(x2, y2). The slope m of a line…
A: #Student Id:#Full Name:#Section Number:from math import infimport sys def printHeader():…
Q: Using a text editor, create a file that contains a list of at least 15 six-digit account numbers.…
A: /File: ValidateCheckDigits.java import java.io.BufferedWriter; import java.io.File; import…
Q: In Python Prompt the user for a text file that contains a list of student names, one on each line.…
A: NOTE: Follow proper indentation. sample data not given in the question. so, random data considered…
Q: A vehicle inspection station keeps records of its checking services in a text file (called…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: ase provide line by line explaination for the code below. And I don't understand line 16, so detail…
A: Description: 1- For line number - 16, Date is a class provided by the java util package. Please…
Q: 2. The manager of a basketball stadium wants you to write a program that calculates the total ticket…
A: The below program is written using C++ language and it can be compiled successfully.
Q: The file akaroawindgusts.txt contains hourly maximum wind gusts speeds at the Akaroa Electronic…
A: see solution in step No. 2
Q: Write a second C++ Program (FileTemps.cpp) that reads the names and temperatures of the n cities…
A: C++ Code is given below:
Q: I this question, you will be given a list of integers, and you have to write in a text file named…
A: Given:- İn python
Q: Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100 lines. 2. Each line in…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Assume that numbers.txt is a textfile with non-negative integers, with one per line, with -1 on its…
A: As no programming language is mentioned, it is solved using basic C++
Q: ask: Loading data from files This exercise will require you to load some information from files and…
A: Java code is implemented below
Q: In Python Take the Deck of cards we created in Problem Solving Exercise: Shuffle and Deal Cards and…
A: Note: we had provided answer according to given hints provided in solution parts.
Q: Write a program, which writes the even elements of an integer array to a file called…
A: Start Declare an array with values. Find the size of the array. for (i=0 : n ) do if(arr[i]%2==0) do…
Q: I this question, you will be given a list of integers, and you have to write in a text file named…
A: In the solution of the given problem to print the bar into the file, first, we need to open file…
Q: 29. Write an application that removes extra spaces from a text file. In the days of the typewriter,…
A: Ans 29. The following are the identified program tasks from the given application: Step 1: Get an…
Q: Write a program that will read in a file of student academic credit data and create a list of…
A: The Java program is written where it takes the input student file and add the GPA function to the…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: In the given version of code, code is not properly indented. and content of list sg is like…
Q: f) Create a file randomNumbers.txt and fill the file with 100 random numbers in the range [11,99].…
A: Create a file randomNumbers. txt and fill the fille with 100 randomnumbers in the range [11,99].…
Q: Using a text editor, create a file that contains a list of at least 15 six-digit account numbers.…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: I this question, you will be given a list of integers, and you have to write in a text file named…
A: def file_plot(l1): l2 = [] for j in range(0, len(l1)): l2.append(l1[j])…
Q: GRADEBOOK PROJECT Attached Files: Gradebook.docx (18.278 KB) Gradebook Practicla Project: use the…
A: Here we have given the program for given appropriate grades. You can find the code in step 2.
Q: Write a program that prompts the user for an input file name, reads all words from the input file,…
A: Code:- #include <iostream>#include <string>#include <fstream>using namespace std;…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: The answer given as below:
Q: This is a Python program Reads information from a text file into a list of sublists. Be sure to…
A: A require program is as follows, import datetime import os # Define a function that returns a list…
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: and output txt file name. The input text file will have exactly 10 lines. Each line will have: 1-…
A: Actually, array is a collection of elements.
Q: Problem A straight line can be defined by a pair of points p.(x1, yı) and p2(x2, yz). The slope m of…
A: PROGRAM CODE: from math import infimport sys def printHeader():…
Q: This is a Python Programming question
A: Since you have not mentioned the sample output in the question so, we have provided the output in…
Q: 8) Write a program that finds pairs of numbers between 1 and 49 that have no common divisor other…
A: As no programming language is mentioned, it is solved using basic C++
Q: A vehicle inspection station keeps records of its checking services in a text file (called…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: This is for Python - COP 1000, I have to use def main. I have attached the program I need help with…
A: I have implemented the code as per the instruction given. The code is as follows: def main(): i…
Q: I this question, you will be given a list of integers, and you have to write in a text file named…
A: Given below is the python code for the same: Please take care of the proper indentation while…
Q: Add this comment: # LAB 5: Part 2 Write a program that calculate the sum and the average of random…
A: Answer in step2
Q: rite python program does the following: Reads a csv file named "train_final.csv" Print the last 100…
A: To read a csv file into a pandas DataFrame, you can use import pandas as pddf =…
Q: Write a second C++ Program (FileTemps.cpp) that reads the names and temperatures of the n cities…
A: C++ Program for above : #include <bits/stdc++.h> using namespace std; int main() {…
Q: Write a program to generate a file numbers.txt that contains the first 50 odd natural numbers and…
A: ANSWER: Odd Number:
Q: Extend the program to display which player has the highest batting average (hits / atBats) and that…
A: Program description: C++ program will read an input file, stats.txt that contains the name, number…
Q: Develop an M-file that is asked the user to pass a numeric grade from 0 to 100 and returns a letter…
A: Code: n=input('Enter numeric grade: ')if n >= 90 && n<=100 grade='A';elseif n >=…
Q: a random text file given as input in Python however, each line that you read and read transfers from…
A: # provide input file with text# read input file ip.txt in read modewith open("ip.txt", "r") as file:…
Q: Write a program that will read names, ids, dept names, and cgpa of some students from a file and…
A:
Q: Given a text file containing the availability of food items, write a program that reads the…
A: Code Screenshot :
Q: here is a text file containing the details of several invoices details. Each invoice uses 3 lines of…
A: Please upvote. I am providing you the correct answer below. Please please please.
Q: In Java Oleae nust read a file A photographer is organizing a photo collection about the national…
A: Actually, Java is a general-purpose also class-based, object-oriented programming language designed…
Q: student information from a tab separated values (tsv) file. The python program then must creates a…
A: Given data is shown below: PYTHON: I need to get the avg statement out of the loop so that the…
Q: In the attached city list.txt file, the names of the provinces in Turkey are given in a single line…
A: Algorithm: Start Create file reader object by passing list.txt as file name Create file writer…
Q: reads in a file of student academic credit data. Each line of the input file will contain the…
A: Programming is instructing a computer to do something for you with the help of a programming…
Step by step
Solved in 2 steps with 1 images
- The history teacher at your school needs help in grading a True/False test. The students’ IDs and test answers are stored in a file. The first entry in the file contains answers to the test in the form:TFFTFFTTTTFFTFTFTFTTEvery other entry in the file is the student ID, followed by a blank, followed by the student’s responses. For example, the entry:ABC54301 TFTFTFTT TFTFTFFTTFTindicates that the student ID is ABC54301 and the answer to question 1 is True, the answer to question 2 is False, and so on. This student did not answer question 9. The exam has 20 questions, and the class has more than 150 students. Each correct answer is awarded two points, each wrong answer gets one point deducted, and no answer gets zero points. Write a program that processes the test data. The output should be the student’s ID, followed by the answers, followed by the test score, followed by the test grade. Assume the following grade scale:90%–100%, A; 80%–89.99%, B; 70%–79.99%, C; 60%–69.99%, D; and…Using a text editor, create a file that contains a list of at least 15 six-digit account numbers. Read in each account number and display whether it is valid. An account number is valid only if the last digit is equal to the remainder when the sum of the first five digits is divided by 10. For example, the number 223355 is valid because the sum of the first five digits is 15, the remainder when 15 is divided by 10 is 5, and the last digit is 5. Write only valid account numbers to an output file, each on its own line.*Note that the contents of the file AcctNumsIn.txt will change when the test is run to test the program against different input. AcctNumsIn.txt 345619789400871208901156984334723422172257100000273699237485761200555500936716763542999995 import java.nio.file.*;import java.io.*;import java.nio.channels.FileChannel;import java.nio.ByteBuffer;import static java.nio.file.StandardOpenOption.*;public class ValidateCheckDigits {public static void main(String[] args) {Path…Using a text editor, create a file that contains a list of at least 15 six-digit account numbers. Read in each account number and display whether it is valid. An account number is valid only if the last digit is equal to the remainder when the sum of the first five digits is divided by 10. For example, the number 223355 is valid because the sum of the first five digits is 15, the remainder when 15 is divided by 10 is 5, and the last digit is 5. Write only valid account numbers to an output file, each on its own line.*Note that the contents of the file AcctNumsIn.txt will change when the test is run to test the program against different input. AcctNumsIn.txt345619789400871208901156984334723422172257100000273699237485761200555500936716763542999995 ValidateCheckDigits.javaimport java.nio.file.*;import java.io.*;import java.nio.channels.FileChannel;import java.nio.ByteBuffer;import static java.nio.file.StandardOpenOption.*;public class ValidateCheckDigits {public static void…
- Using a text editor, create a file that contains a list of at least 15 six-digit account numbers. Read in each account number and display whether it is valid. An account number is valid only if the last digit is equal to the remainder when the sum of the first five digits is divided by 10. For example, the number 223355 is valid because the sum of the first five digits is 15, the remainder when 15 is divided by 10 is 5, and the last digit is 5. Write only valid account numbers to an output file, each on its own line. Note that the contents of the file AcctNumsIn.txt will change when the test is run to test the program against different input.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")First, take your program and add one more feature: at the end, just before you close the file, write the word “END” all by itself on a line. Run that program once to create a file of items with “END”. Instead of reading from cin and writing to a file, you read from your file and write to cout. The only tricky part is deciding when to stop reading. In your previous code, you stopped reading when the user said they didn’t want to continue. For the new code, keep reading until you read “END” for the name of the produce. You can use “==” on strings, so if (product name == ”END”) will tell you that you can stop reading. My code: #include<iostream>#include<string.h>#include<fstream>using namespace std; int main(){ string filename; cout<<"Enter the name of the file to store the information"<<endl; getline(cin,filename); ofstream fileptr(filename.c_str()); if(!fileptr.is_open()) { cout<<"Couldn't open a file"<<endl; }…
- 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 the-zen-of-python.txt and writes each line to UpdatedZen.txt, a new text file. It capitalizes the first character of each line and adds a period to the end of each line before writing it back to updatedzen.txt. the-zen-of-python.txt file contents: beautiful is better than ugly explicit is better than implicit simple is better than complex complex is better than complicated flat is better than nested sparse is better than dense readability counts special cases aren't special enough to break the rules although practicality beats purity errors should never pass silently unless explicitly silenced in the face of ambiguity, refuse the temptation to guess there should be one-- and preferably only one --obvious way to do it although that way may not be obvious at first unless you're Dutch now is better than never although never is often better than *right* now if the implementation is hard to explain, it's a bad idea if the implementation is easy to explain, it…Assume that you will be given a *.txt file, which in the same format of RandSource.txt(attached). The file has three numbers at each line. Numbersare separated with a space. All number are in the range of [0, 50]. The first two numbers indicate a range. The third one shows number of random numbers to be generated in the range of first two numbers. The range always given in first < second order. If not, raise an error. For instance, 2 5 7 means that you need to generate 7 random numbers in the range of 2 - 5 (including 2 and 5). You need to develop a complete C++ program to read each line from the .txt file and print the result on screen in a formatted way. The output format will be <first number> - <second number>: <random numbers > . For the above example, the output to screen should be 2 - 5: 6 5 4 6 3 7 5The attached input file has,3 6 82 19 104 12 41 6 07 4 30 8 310 9 8Your program should generate this (or with different random numbers) output for this file3…
- Write a program that receives a filename as user input. The file is structured as multiple lines containing numbers separated by a single space.For example, this would be an acceptable file: 1 2 3 4 5 6 7 2 Your program should open this file and: print all its contents; write the median of all numbers to a new file called result.txt. IMPORTANT NOTES: the median is the element in the middle when you sort the values; the median of values (2, 1, 3) is 2, because when you sort them, you get 1, 2, 3, and 2 is the value in the middle. you can assume there will be no empty lines; there might be any arbitrary number lines in the file; there might be any arbitrary number of elements in a single line; you can assume there will always be an odd number of elements. Example 1: If input is: file1.txt and the contents of file1.txt are: 1 2 2 you should first print the content, and then write 2 to result.txt. Example 2: If input is: file2.txt and the contents of file2.txt are: 1 2 3 4 5 1 7 you…Write a program that reads two input files whose lines are ordered by a key data field. Your program should merge these two files, writing an output file that contains all lines from both files ordered by the same key field. As an example, if two input files contain student names and grades for a particular class ordered by name (the key field), merge the information as shown below. File 1 and file 2 are supplied. Here is an algorithm to merge the data from two files: Read a line from each data file While the end of both files has not been reached While the end of both files has not been reached Write the line from file 1 to the output file and read a new line from file 1. Else Write the line from file 2 to the output file and read a new line from file 2. Write the remaining lines (if any) from file 1 to the output file. Write the remaining lines (if any) from file 2 to the output file. See the Merging Filesslides attachedto the project in Canvasfor a visual look at this algorithm.Once the modelling has been run, the user should have the option to rerun it. Each time it is run, the output should be saved to disk with the following filename: report_s.txt, where s is a number returned by int(time. time() ) (time. time() is a function from the time module, which you will need to import). This returns the number of seconds since 1/1/70 so that each value of s will be a unique timestamp. For example, the file may look like this: report_1586386072.txt. Part 2: In addition, your program must be able to visualise the information. The user should be able to choose the year and see two-liner graphs based on monthly averages of trade volume and monthly averages of the closing value