Write a program that allows the user to create and maintain a list of contacts in a file contact will have a name and a phone number. In the file, each line should have a con phone number you may assume that ev single word (i.e. no last names) For example, if your file has two contacts in it, it might look something like this: Bob 555-1234 Jill 555-4321 Recall that if you try to open a file for reading before it exists, the program will crash.
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 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 program that does the following: Reads information from a text file into a list of…
A: Actually, the code has given below:
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: 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: Write a program that asks the user how many words they would like to write to a file, and then asks…
A: the code for the above program is
Q: Write a program that first reads in the name of an input file and then reads the file using the…
A: Here, Code instruction is given.
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 program that transfers the contents of one file to a second file. The first file will…
A: given data Write a program that transfers the contents of one file to a second file. The first file…
Q: Write a program that opens a file me.txt and write your first name followed by a space followed by…
A: The program has been written in python language.
Q: Write a program that reads a stream of integers from a file and writes only the positive numbers to…
A: The program is written in Java. Please check the below step for the source code.
Q: Write a program that first reads in the name of an input file and then reads the file using the…
A: Step 1 : Start Step 2 : Import the csv module and declare the freq dictionary. Step 3 : Take user…
Q: Write a program that allows the user to navigate the lines of text in a file. The program should…
A: Python Code: #accepting file name (name=input("Enter the input file name:") #printing newline…
Q: Write a program that reads the attached file called input.txt , and creates an output.txt file that…
A: Here I have opened 2 files, input.txt in read mode and output.txt in write mode. Next, I have read…
Q: Write a program that opens a text file called quiz.txt for reading. This file contains a single line…
A: Note: Programming language is missing in the question. So we will answer this program in C++. If you…
Q: Write a program that reads the contents of a file named text.txt and determines the following The…
A: #include <iostream> #include <fstream> using namespace std; int main() { ifstream…
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 which reads the content of two files “text1.txt” and “text2.txt” line byline and…
A: This program is dealing with the file operations in C programming. In C, pointers are used to…
Q: Write a program that reads a file of numbers of type int and writes all the numbers to another file,…
A: #include <iostream>#include <iomanip> // re. setw#include <fstream> using…
Q: Write a program that allows the user to navigate the lines of text in a file. The program should…
A: Python Code: #accepting file name (name=input("Enter the input file name:") #printing newline…
Q: Write a program that allows the user to navigate the lines of text in a file. The program should…
A: Program enterfile = input("Enter the file name: ") file = open(enterfile, 'r') linecount = 0 for…
Q: Write a program in MIPS that does the following: Request the name of a file from the user and open…
A: Write a program in MIPS that does the following: Request the name of a file from the user and open…
Q: Write a program that allows the user to navigate the lines of text in a file. The program should…
A: Logic to proceed Reading the given file by user input. The text read from the file will contain…
Q: Write a program that receives a coded message file(Lab3ExtraCreditCT.txt) from your local espionage…
A: Programming is a way to instruct the computer devices to operate. Every computer needs a set of…
Q: A program that will read line of a stream of integers from a FILE. Reverse each number and compute…
A: SUMMARY: -Hence, we got the output.
Q: In Python IDLE Write a program that reads the file’s contents and determines the following:…
A: As I have read the guidelines I can provide answers to only 1 part of the questions in case of…
Q: a. Write a program that prompts the user for a file name, then reads that file (assuming that its…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: write a program with python that asks the user to enter two filenames. One file contains a list of…
A: Note: Follow proper indentation as specified in the code snapshot while implementing code. Random…
Q: Write a program that first reads in the name of an input file, followed by two strings representing…
A: EXPLANATION: Create a text file txt that contains the given strings (alphabetically arranged).…
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 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 reads a file consisting of students' test scores in the range 0-200. It should…
A: Store the given scores in a text file and open a file in reading mode using the ifstream object.…
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: 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 first reads in the name of an input file and then reads the file using the…
A: Programming instructions: Import necessary header files. Take the file name from the user.…
Q: Write a program that will sequentially list numbers from 0 to 50, changing its color depending on…
A: Step 1 : Start Step 2 : Define a function delay() to print the numbers in an interval of 1 second.…
Q: Write a program that asks the user for the name of a text file, and then prints to the screen the…
A: import osimport sys def main(): file_name = input("Enter the name of the file: ") if…
Q: Write a program that prompts the user for an input file name, reads all words from the input file,…
A: Solution:-- 1)The question given in the portal is been required for the solution which is to be…
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: 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 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 that first reads in the name of an input file and then reads the file using the…
A: Initially make Sure to save the file before executing as shown below: Executable Code: import csv #…
Q: Write a program to do the following: - 1) Read the file Mydata.txt which includes unlimited number…
A:
Q: Write a program named Lab9b_Act2.py that will write to a file a list of amortized values for a loan.…
A: Actually, python is a easiest programming
C++ Question:
See Attached picture. Follow all instructions. Please create the code yourself. Thanks!!!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 6 images
- 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 removes all the occurrences of a specifiedstring from a text file. For example, invokingjava Exercise12_11 John filenameremoves the string John from the specified file. Your program should get thearguments from the command line.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 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 program called ReverseText.exe that takes two file names as command-line arguments. TheReverseText program should reads the characters from the first file and write them into the second file inreverse order. Test your program out using the small text file iso_8859-1.txt provided with thisassignment. Once you are confident that your program is working correctly, run it on the much larger fileWar_of_the_Worlds.txt uploaded along with this assignment. For example, when you use this program on the command line it should be like this:ReverseText.exe War_of_the_Worlds.txt War_of_the_Worlds_reversed.txt Remember, if you are using fgets(), it will only return one line of the book at a time. You willhave to go through the book multiple times and make frequent use of the rewind() function.HintYou can use the strlen() function (that is part of the string.h C Standard Library) to check thelength of the string you read in using fgets(). ALSO, if you could please help me know and…Write a program in a single file that: Main: Creates 10 random doubles, all between 1 and 11, Calls a method that writes 10 random doubles to a text file, one number per line. Calls a method that reads the text file and displays all the doubles and their sum accurate to two decimal places. SAMPLE OUTPUT 10.62691196041722.7377903389094555.4279257388651281.37420580654725091.18587002624988364.1803912764852284.9109699989306755.7108582343439587.7908570073730523.1806714736219543 The total is 47.13
- 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…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 replace each line of a file with its reverse. for example, if you run: java Reverse HelloPrinter.javathen the contents of HelloPrinter.java are changed to retnirPolleH ssalc clibup{)sgra ][gnirtS(niam diov citats clibup{wodniw elosnoc eht ni gniteerg a yalpsiD // ;) "!dlroW ,olleH " (nltnirp.tuo.mestyS}}
- Write a program that reads the scores from numbers.txt a line at a time and displays their total and average. Since you don’t know how many scores, you will need to keep looping until readline is blank. numbers.txt is a file that contains a list of scores. numbers.txt 10 25 36 45 89 42 54 create a program that reads the scores from numbers.txt file one line at a time. The program should display their total and average. since the number of scores is unknown, the program must keep looping until readline is blank. Please write as simple as possible and use good variables. Thank you. Sample Output: There are 7 scores The total is 301 The average is 43.0Write a program that reads every line in a text file, removes the first wordfrom each line, and then writes the resulting lines to a new text file.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…