Consider a file log.txt. Each line contain a log output from a certain mail application. From: a@gmail.com To: b@gmail.com From: a@gmail.com To: c@gmail.com From: b@gmail.com To: c@gmail.com Now write a program to read from the file and find out how many times each sender has sent the message. Output the number in a output.txt file: а 2 b 1
Q: Write a program which reads from a file all digits and prints the largest number which is a multiple…
A: C++ program: #include<iostream>#include<fstream> using namespace std; int main() {…
Q: Write a Java program that will provide a count of the number of words, number of lines, and/or…
A: Required: Write a Java program that will provide a count of the number of words, number of lines,…
Q: Write a program that first reads in the name of an input file and then reads the file using the…
A: Given code: #Header file import csv #Getting the input file file = input() #Initializing frequency…
Q: A record from a binary file named SDQCC.BIN has, in this order, 3 integers, a character and then two…
A: 1. open the file 2. run loop from i = 0 to 200 a. get input first number b. get input…
Q: Write a program that prompts the user for an input file name, reads all words from the input file,…
A: ALGORITHM:- 1. Take input for file name from user. 2. Read the data from it. 3. Write that data into…
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 program that replaces all occurrences of a word with anew word in all the files under a…
A: Program: //include the required header files import java.io.*; import java.util.Scanner;…
Q: Problem A: Write a Python program that reads a list of strings from a file "strings.txt" (see Figure…
A: As per the above question ============ ========output screenshot============ ================full…
Q: Write a program that will read the file text.txt which is provided and the encrypted message in…
A: Program code: //import the required packages import java.util.*; import java.io.*; //define a…
Q: Write a test client which takes a file path as an argument and reads each line one by one. The file…
A: A DNA string is a Watson-Crick palindrome when the complement of its reverse is equal to itself.…
Q: Write a program that first reads in the name of an input file, followed by two strings representing…
A: Solution:: Python code :: #Taking inputs from the user file_name=input("Enter the Path and name…
Q: Write a program that generates 10 random doubles, all between 1 and 11, and writes them to a text…
A: In the first program – Create an object for a file. Take an array of double type. Open a file using…
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: Consider a CSV file contains information about COVID-19 status of Bangladesh. The header of this…
A: Solution- Programming Language - Java All necessary comments are included in program code. Store…
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: Write a word-wrapping program ww that reads the contents of a file and prints it to standard output,…
A: In figuring, word wrapping is an interaction by which a word which comes toward the finish of a line…
Q: xt contains a large number of English Language words, one per record. Write a program that uses this…
A: A file words.txt contains a large number of English Language words, one per record. Write a program…
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: Problem A: Write a Python program that reads a list of strings from a file "strings.txt" (see Figure…
A: def displayHeader(): print("=========================================")…
Q: Write a program that reads the scores from numbers.txt a line at a time and displays their total and…
A: We will read from the file and loop till end of file and have a counter to count no of elements then…
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 in a .py file that implements a new encryption algorithm that includes the…
A: # User enters a plaintext stringplainText = input("Enter message: ") # First we must convert the…
Q: Write a program that first reads in the name of an input file and then reads the file using the…
A: CODE:- import csv n = input()with open(n, 'r') as myfile: Reader = csv.reader(myfile,…
Q: Write a CH program to do the following Read the given file “marks.txt" 3 b. Write all the passed…
A: fstream is a stream used to read or write the contents from a file or to a file
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 python code Q1: Write a function that reads all words from a file (.txt) (space separation)…
A: Given data, Write a function that reads all words from a file (.txt) (space separation) and returns…
Q: Your goal is to write one per line in a text file. n numbers stored as numbers to determine the…
A: Aim: To determine the largest k numbers among n numbers stored in a text file with one number per…
Q: The expected output as given in Figure 2: Postageliammeny bt - Netepae File Edt Format View Hele…
A: It seems that the given answer is not correct so instead of using the given code I am writing the…
Q: Write a programme called pgmReduce which takes 3 arguments: 1. an input file (either ASCII or…
A: Please upvote/like. I am providing you the java code for resize the input image.
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 will input the contents of a text file containing integers then writes each…
A: CODE WITH OUTPUT:- SAMPLEINPUT.TXT = 1 3 4 3 2 5 6 4 2
Q: Write a program to change the alphabets in a file in following manner. Replace each alphabet with…
A: The required C++ code is: #include<iostream>using namespace std;int main(){ char ch,…
Q: Print "CS2253" with a program starting at address x3000 that loops rough the individual characters,…
A: 3000: MOV 30A0, 000F /* loads the value 000F into the memory address 30A0 */ 3001: LOAD 3020,…
Q: You are going to apply that technique to an integer number of 5 digits. Create a .cpp file named…
A: #include<iostream>using namespace std;int main(){ // Enter key value k: 3 // Enter a…
Q: Write a program that prompts for a file name, then opens that file and reads through the file…
A: We have to program a prompt file name, open that file, read through the file. Python Program def…
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: Suppose we have a file STD.doc containing roll numbers, name and marks of some students. Write a…
A: The required c Program code is given below:…
Q: Write a function num_double to read file (f1.txt), double all the numbers, keep the string (no…
A: Here I have defined the function named num_double() Inside the function, I have traversed each word…
Q: Write a program that transforms the user input stream: (1st) A B C A B C A B C (last) into the…
A: Here our task is to transform user input to the given format. User input will be a string, if we are…
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 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 that inputs the names of fifteen cities and stores them in a file city.txt and then…
A: Task: Write a program that inputs the names of fifteen cities and stores them in a file city.txt and…
Q: Write a program that will countthe number of characters, words, and lines in a file. Words are…
A: import java.io.*; import java.util.*; public class Exercise12_13 { public static void…
Object Oriented
Step by step
Solved in 2 steps
- SOLVE IN C# A bank store its client balance in amount.txt file as follow 332000 2320000 540000 45000 321000 Write a program to read the file and print the total amount store in amount.txt file, and then write this amount on screen and to a new file name backup.txtSuppose a library is processing an input file containing the titles of books in order to identify duplicates. Write a program that reads all of the titles from an input file called bookTitles.inp and writes them to an output file called duplicateTitles.out. When complete, the output file should contain all titles that are duplicated in the input file. Note that the duplicate titles should be written once, even though the input file may contain same titles multiple times. If there are not duplicate titles in the input file, the output file should be empty. Create the input file using Notepad or another text editor, with one title per line. Make sure you have a number of duplicates, including some with three or more copies.Suppose a library is processing an input file containing the titles of books in order to identify duplicates. Write a program that reads all of the titles from an input file called bookTitles.inp and writes them to an output file called duplicateTitles.out. When complete, the output file should contain all titles that are duplicated in the input file. Note that the duplicate titles should be written once, even though the input file may contain same titles multiple times. If there are not duplicate titles in the input file, the output file should be empty. Create the input file using Notepad or another text editor, with one title per line. Make sure you have a number of duplicates, including some with three or more copies. (Programming Language: Java)
- from Big Java 6th. Edition. Ch.11 P11.12: the capacitor is represented by the equation v(t) = B(1 - e-t/(RC)) Suppose the parameters of the electric circuit are B = 12 volts, R = 500 Ω, and C = 0.25 μF. Consequently v(t) = 12(1 – e-0.008t) where t has units of μs. Read a file params.txt containing the values for B, R, C, and the starting and ending values for t. Write a file rc.txt of values for the time t and the corresponding capacitor voltage v(t), where t goes from the given starting value to the given ending value in 100 steps. In our example, if t goes from 0 to 1000 μs, the twelfth entry in the output file would be: 110.00 7.02261 Make sure that your program catches the FileNotFoundException that can occur if your input file params.txt cannot be found. Your program should catch this exception, and then prompt the user for a file name again until a valid file is entered. I hbelieve I have everything needed, but I cannot figure out how to write in the…Write a C program, called reverse, using standard I/O functions, to take a file as inputthen copies it to another file in reverse order. That is, the last byte becomes the first,the byte just before the last one becomes the second, etc.The program call should look like:reverse fileIn fileOutSubmit your source code and script filesWrite an address book program that stores your contacts' names and their email addresses. The names and email addresses are originally stored in a file called phonebook.in, in the format: Harry Potter t..d@hogwarts.edu Hermione Granger b..h@hogwarts.edu Ron Weasley r..b@hogwarts.edu Draco Malfoy m..s@hogwarts.edu Severus Snape h..e@hogwarts.edu Albus Dumbledore a..x@hogwarts.edu Your program should read from the file, storing the names and corresponding email addresses in a dictionary as key-value pairs. Then, the program should display a menu that lets the user enter the numbers 1 through 5, each corresponding to a different menu item: 1) look up an email address 2) add a new name and email address 3) change an email address 4) delete a name and email address 5) save address book and exit When the user enters 1, the program should prompt them for a name, and then print the corresponding email address. If there is no dictionary entry under that name, the program should print, "Sorry,…
- Modify the program 11-10 from pages 753-755 as follows: 1. To Length class files (Length.h and Length.cpp) add the operator overload for stream insertion (<<) and stream extraction (>>) from page 759. You should not use the modified version of class Length from page 759 because it contains more operator overloads. Instead of typing you can use copy/paste from Length1.h and Length1.cpp respectively. 2. In main() replace the lines 11-16 with appropriate usage of stream extraction overload (>>) to change "first" and "second" objects with values inputted by the end user. 3. In main(), replace the output on lines 21,22 and 25,26 with appropriate usage of stream insertion (<<) operator. The resulting output should be identical with the unmodified version of the program. 11-10: // This program demonstrates the Length class's overloaded // +, -, ==, and < operators. #include <iostream> #include "Length.h" using namespace std; int main() { Length first(0),…Write a C program, called reverse, using standard I/O functions, to take a file as inputthen copies it to another file in reverse order. That is, the last byte becomes the first,the byte just before the last one becomes the second, etc.The program call should look like:reverse fileIn fileOutModify the scripts of Projects 1 and 2 to encrypt and decrypt entire files of text. An example of the program interface is shown below: Enter the input file name: encrypted.txt Enter the output file name: a Enter the distance value: 3 Project 1: text = (input("Please enter your text: ")) shift = int(input("Please enter the shift: ")) def circularShift(text, key): text = text.upper() cipher = "" for letter in text: shifted = ord(letter) + key if shifted < 65: shifted += 0 if shifted > 90: shifted -= 0 cipher += chr(shifted) return cipher print (circularShift(text, shift)) Project 2 text = (input("Please enter your text: ")) shift = int(input("Please enter the shift: ")) convert = -(shift) def cypher(text, key): text = text.capitalize() cipher = "" for letter in text: shifted = ord(letter) + key cipher += chr(shifted) return cipher print (cypher(text, convert))
- Follow these steps:● Create a Python file called amazon.py in this folder.● Write code to read the content of the text file input.txt.● For each line in input.txt, write a new line in the new text file output.txtthat computes the answer to some operation on a list of numbers.● If the input.txt has the following:o Min: 1,2,3,5,6o Max: 1,2,3,5,6o Avg: 1,2,3,5,6● Your program should generate output.txt as follows:o The min of [1, 2, 3, 5, 6] is 1.o The max of [1, 2, 3, 5, 6] is 6.o The avg of [1, 2, 3, 5, 6] is 34Write a Python program to combine each line from the first file with the corresponding line in the second file and then save it in a 3rd file. Consider, both the files have same number of lines. Assume, each line has a newline(\n) at the end. ========================================================= Example:Input from file 1:HelloHiNice Input from file 2:BadWorseWorst Output in 3rd FIle:Hello BadHi WorseNice Worst ========================================================= Hint(1):Use the write() function what will be the answer of this in python programming languageWrite a word-wrapping program ww that reads the contents of a file and prints it to standard output, wrapped to fit within a specified width. For example, to reformat “text.txt” to fit in 80 columns: $ ./ww 80 text.txt