a. Create a text file named info.dat containing the following data (without the headings): Name Social Security Number Hourly Rate Hours Worked B Caldwell 555-88-2222 10.50 37 D Memcheck 555-77-4444 12.80 40 R Potter 555-77-6666 16.54 40 W Rosen 555-99-8888 11.80 35 b. Write a C++ program that reads the data file created in Exercise 7a and computes and displays a payroll schedule. The output should list the Social Security number, name, and gross pay for each person, calculating gross pay as Hourly Rate × Hours Worked.
Q: Exercise 4: Write a python program that reads from a text file whose name is provided by the user, a…
A: Answer in step2
Q: QUESTION 30 Write a Python function which will find the longest word in a file. The name of the file…
A: Required:
Q: Consider a file named transaction.txt which contains unknown number of lines. Each line contains…
A: Purpose: This program reads transactional information about several users. It will print the number…
Q: Write a C++program to read a series of product names, count, and price of each item in a file called…
A: The answer is given below.
Q: rite a python program that reads from a text file whose name is provided by the user, a list of a…
A: Note: store order1.txt file and python file in same location Code: import sys fileName =…
Q: 1. Write a program in C to create and store information in a text file. Test Data: Input a sentence…
A: The code for the above-given question is given below:
Q: Given a text file, refer to the example and write a program (console application) that counts the…
A: using System; using System.IO; namespace ReadTextFile { class Program { // Default folder…
Q: Question #5: Write a C program that reads real numbers from a data file named "numbers.txt",…
A: Given: Question #5: Write a C program that reads real numbers from a data file named "numbers.txt",…
Q: 2.14 Write a program that has the following character variables: first, middle, and last. Store your…
A: The Answer is in given below steps
Q: 2) Write a program which takes two points from a file and prints the distance between them to…
A: Actually, program is a executable software that runs o a computer.
Q: 2. Write a program that asks the user for the name of a file. The program should read all numbers…
A: #asking user to enter file namefileName = input('Enter filename:')file = open(fileName, 'r')#opening…
Q: Exercise 1: Write a python program that reads from a text file whose name is provided by the user…
A: The complete code is given below with the output.
Q: int i, exam, maxExam - 0, choice- 0, course_no; int total_stu[10001={0); printf("------ printf("\n…
A: 1) int ---> the argument of the function is integer 2) int ---> the return type of…
Q: Problem Write a program that reads a comma delimited CSV file with four columns and returns the…
A: Required: Problem Write a program that reads a comma delimited CSV file with four columns and…
Q: • Exercise # 1 Write a program that reads a file containing text. Read each line and send it to the…
A: In step 2, you will get python code. In step 3, you can see the sample output.
Q: Question 3 Given a text file containing unknown number of lines, each line containing three integer…
A: The question be done by reading the input from the file with the help of a while loop with a break…
Q: Write a C program which performs the following tasks: a. Create a Number.txt file b. Write a program…
A: for(int i=1;i<11;i++) { int square,cube; square = i*i; cube = i*i*i;…
Q: Exercise 4: Write a python program that reads from a text file whose name is provided by the user, a…
A: the program is an given below : Note: store order1.txt file and python file in same location Code:…
Q: write a python code for reading and appending data in the file, 1. create a file having the data as…
A: Python has features of inbuilt methods which can be used for creation, writing and reading files…
Q: Write a program segment that reads a text file named original_text, and displays how many times the…
A: Here I have open the file in read mode. Then, I have read all the data from the file and stored it…
Q: 3. Write a program that takes as an input file the number of chapters in each book of the Bible. The…
A: #include <stdio.h>#include <stdlib.h>#include <string.h>// structure to store book…
Q: You will create a new version of the restaurant ordering program you created below in which the…
A: Question: create a new version of the restaurant ordering program in which the menu and pricing…
Q: Program 5: Word Frequencies (Concordance) Use a text editor to create a text file (ex:…
A: Python Program to copy:- from os import pathimport sysdef fileExists(fileName):…
Q: (Use DevC++) 2. Student Grade Write a program that reads a student name followed by five test…
A: The method of generating a series of instructions that instruct a machine how to accomplish a job is…
Q: write a python code for reading and appending data in the file, 1. create a file having the data as…
A: file1 = open("myfile.txt", "w")L = ["XXXX 000000 New York \n"]file1.writelines(L)file1.close()
Q: Write a program which reads the first two characters from the file “chars.txt” and writes thesum of…
A: This program is implemented in C. Please find the source code and output below.
Q: What does the following Python code do? fhand = open('mbox-short.txt') inp = fhand.read() a. Prompts…
A: Option b is correct answer
Q: 2:56 D Write a program that finds the number of times a specific word appears in a text file. The…
A: Code: #include <iostream>#include <fstream>#include <algorithm>using namespace…
Q: You are given a filename. Read the names in the file and output only the initials. For example, if…
A: In the question we are required to print the first letter of word after "," for each line in reverse…
Q: Create an Input File with the following information regarding to inventory: Item_Id Price ? Write a…
A: # include <iostream.h> # include <conio.h> # include<fstrean.h>…
Q: Exercise 1: Write a Python program that reads from the user the name of two files (an input file and…
A:
Q: Exercise 1: Write a python program that reads from a text file whose name is provided by the user…
A: def areafun(s,d): area=0 if (s=="Circle"): area = 3.14*d*d elif(s=="Triangle"):…
Q: 1. Write a $\mathrm{C}++$ program that prompts the user to enter a file name that contains the…
A: #include<iostream>#include<fstream>using namespace std; int main(){ string file_name;…
Q: Given the following, write a code SEGMENT that does the following: Creates a string variable to…
A: Note: Programming language is missing in the question. So we will answer this program in C++…
Q: Exercise 1: Write a python program that reads from a text file whose name is provided by the user…
A: from os import pathfile_name=input("enter file name: ")if(path.exists(file_name)): #checking if file…
Q: Problem A straight line can be defined by a pair of points pi(x1, yı) and p2(x2, y2). The slope m of…
A: code: from math import inf def getCoordinates(s):#strip and split the line to get the…
Q: 6. a. Write a C++ program that opens a file and displays its contents with line numbers. That is,…
A: Hey, since there are multiple questions posted, we will answer first question. If you want any…
Q: appending or reading in data test_file variable.
A: Python provides inbuilt functions for creating, writing and reading files. There are 6 access modes…
Q: Question 4 14 Points Suppose you have a file called "MyData.txt". In this file, a list of unknown…
A: The program in C++ is: #include <fstream> #include<iostream> using namespace std; int…
Q: Please complete with Python write a program that reads a file containing text. Read each line and…
A: ALGORITHM:- 1. Take input for the both the filenames from the user. 2. Read line by line the input…
Q: 1. Write a C++ program to do the following a. Read the given file "marks.txt" b. Write all the…
A: Use 3 streams one to read the contents from marks.txt and other two stream s one to write the passed…
Q: Exercise 1: Write a python program that reads from a text file whose name is provided by the user…
A: Given:
Q: Write a C code to add two numbers and display the output. Attach the output file with the code. Urge
A: Below is the required C program. Program Approach: import necessary packages to get the standard…
Q: opens read_it.txt for writing or reading data text_file variable.
A: Phyton provide inbuilt function for reading, writing and creating files. There are six access mode…
Q: Problem A straight line can be defined by a pair of points p1(x1, y1) and p2(x2, y2). The slope m of…
A: from math import infimport sys def printHeader():…
Q: First make 3 text files that each one includes 10 names and also make one text file that includes…
A: Store random data in files and then open the file user mentioned and then we have to iterate over…
Q: Create a text file named car.dat containing the following data (without the headings): Car Number…
A: A required C++ program is as follows, File name: “main.cpp” //Include header files #include…
Q: Please help me with this problem using c++. Also how could you create the program without having to…
A: Actually, the code has given below:
Q: 4. Write a script file that will compute the cosine of an angle using the Taylor series formula:…
A: logic: Read n set i=0,sum=0,x=35 iterate i=0 to i<=n…
7.
a. Create a text file named info.dat containing the following data (without the
headings):
Name Social Security Number Hourly Rate Hours Worked
B Caldwell 555-88-2222 10.50 37
D Memcheck 555-77-4444 12.80 40
R Potter 555-77-6666 16.54 40
W Rosen 555-99-8888 11.80 35
b. Write a C++
a payroll schedule. The output should list the Social Security number, name, and gross
pay for each person, calculating gross pay as Hourly Rate × Hours Worked.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
- 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 go6. a. Write a C++ program that opens a file and displays its contents with line numbers.That is, the program should print the number 1 before displaying the first line, print thenumber 2 before displaying the second line, and so on for each line in the file.b. Modify the program written in Exercise 6a to list the file’s contents on the printer assignedto your computer.7. a. Create a text file named info.dat containing the following data (without theheadings):Name Social Security Number Hourly Rate Hours WorkedB Caldwell 555-88-2222 10.50 37D Memcheck 555-77-4444 12.80 40R Potter 555-77-6666 16.54 40W Rosen 555-99-8888 11.80 35b. Write a C++ program that reads the data file created in Exercise 7a and computes and displaysa payroll schedule. The output should list the Social Security number, name, and grosspay for each person, calculating gross pay as Hourly Rate × Hours Worked.Write a C program named toupper.c that reads the contents of a file, and writes to another file after changing all lowercase letters in the input file to uppercase. The name of the input file and the output file are to be passed as command line arguments. Assume there are only ASCII characters in the input file. The length of the input file is not known beforehand. So make sure your program keeps reading bytes until EOF is reached. Use the library function toupper to concert letters into uppercase. Example: The program is run from the command line as follows; C:\>toupper.exe infile.txt outfile.txt Suppose the contents of the input file infile.txt is: AbcdefG The contents of the output file outfile.txt should be: ABCDEFG
- Our requirement is to keep information of students who are taking “Introduction to Python” in Fall-2021 in a text file named ‘Students.txt’. The first line of text in this file will be header line as follows Write a python code that: Takes StudentID from user as input in a variable ‘inputID’, reads the file line by line and displays the header line and student information when inputID is found in Students.txt, otherwise display a message ‘Record not found in Students.txt’Using Programming C++..... a) Write a program that reads a text file in which each line in the file consists of a first name, a last name, following by 4 grades (double types) like Tim Hanes 78.3 98.0 80.5 72.3 The program must read every line of the text file, find the average of the 4 grades then print the names followed by the averages (one name per line) in a second file as well as on the monitor. b) Create the text file with at least 5 entries with the format given in part (a). Give the absolute path of the file in your computer. Test your program in part 2(a) on this file.Please use python not java or C++ A straight line can be defined by a pair of points p1(x1, y1) and p2(x2, y2). The slope m of a line is defined as follow: ? = ?% − ?' ?% − ?' Your program reads the points from a text file called ‘points.txt’ which contains the coordinates of unknown number of pairs of points as shown in Figure 1. Each line contains four values x1, y1, x2, y2, where x1, y1 are the coordinates of the first point and x2, y2 are the coordinates of the second point. Figure 1. Input file contains unknown number of point pairs Use Spider, to create the following files: (i) The input file ‘points.txt’ shown in Figure 1. (ii) Your Python program that reads from the input file ‘points.txt’, the coordinates of unknown number of pairs of points, computes the corresponding slopes then prints the results on the screen as shown in Figure 2. Figure 2. The output on screen Your program must define and use the following functions: 1. printHeader(...): prints on screen the three lines…
- Write a C program that, given a text file, constructs Huffman code based on the character frequencies of the file and then encodes the file accordingly. The executable must accept the following command line options:• -i filename for the input file • -o filename for the output file Use the fread function, use FILE, size, etc. Please use the following to write the code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <getopt.h>Write a C++program to read a series of product names, count, and price of each item in a file called cart.in to the end. Calculate the cost of each item and the total amount spent before taxes. Assuming the sales tax applied is 5.7%, display the total cost of each item and the total amount after taxes. Output the results to a file called receipts.out. The output must be in the form shown below. Attach the code and screenshot of a successful run on the program. ==== Your receipt Item Count Price/Item Item Total Pens 3 $ 2.99 $ 8.97 Notebook 5 $ 3.00 $15.00 Shoes 1 $ 25.19 $ 25.19 ===================== Subtotal $ 49.16 ===================== Total $ 51.963. Write a function which reads an already existing file “File1.txt” and write digits (0-9) in to a new text file “mynumber.txt” and non digits into a file “Text.txt”.in c++
- (5) Write a function called copy_even_lines() that takes two strings (filenames) as input parameters and copies every other line from the first file into the second. That is, counting from 0, it copies the 0th line, the 2nd line, the 4th line, etc. from the first file to the second file. You may assume that both files exist. (6) Write a python program that asks the user for two filenames and calls your function copy_even_lines() from (5) using those two filenames. If one or more files do not exist, your program must handle the exception by repeating the prompts until valid filenames are entered.Please help me with this code. The code needs to consists of one header file and two c files . Must use the command line to run the program. Below is the input.txt file that needs to be used. Please provide output and the source code for each file in the program. A1, A2 20294 Lorenzana Dr Woodland Hills, CA 91364 B1, B2 19831 Henshaw St Culver City, CA 94023 C1, C2 5142 Dumont Pl Azusa, CA 91112 D1, D2 20636 De Forest St Woodland Hills, CA 91364 A1, A2 20294 Lorenzana Dr Woodland Hills, CA 91364 E1, E2 4851 Poe Ave Woodland Hills, CA 91364 F1, F2 20225 Lorenzana Dr Los Angeles, CA 91111 G1, G2 20253 Lorenzana Dr Los Angeles, CA 90005 H1, H2 5241 Del Moreno Dr Los Angeles, CA 91110 I1, I2 5332 Felice Pl Stevenson Ranch, CA 94135 J1, J2 5135 Quakertown Ave Thousand Oaks, CA 91362 K1, K2 720 Eucalyptus Ave 105 Inglewood, CA 89030 L1, L2 5021 Dumont Pl Woodland Hills, CA 91364 M1, M2 4819 Quedo Pl Westlake Village, CA 91362 I1, I2 5332 Felice Pl Stevenson Ranch, CA 94135 I1, I2 5332…Transcribed Image Text Problem 3) Create a text file that contains the following information: John Doe 2005 124.80 36 Note that the fist line represents the name of the client, the second line represents the year in which the client started an account with this insurance company. The third line represent the monthly payment for the insurance. The fourth line represents the number of months left in the insurance policy. Write a C++ program that will read this file and will display the client's name, the number of years for which this client has been with the company, and the remaining amount they have to pay