Write a program that uses a text file to store weekly payroll data for the office. The program should enable the user to enter the name, hourly pay rate, and weekly hours for a number of office employees. The pay rate and hours should be type float, and each datum should be written to its own line in the file. Enter data for at least five employees and then close the file.
Q: Write a program that asks the user for the name of a file and a string to search for. The program…
A: Program Approach - Use the essential header files as per code requirements. Define the function…
Q: Question: Write a program that reads a series of dates in day/month format, from the file…
A: Given:
Q: Suppose that you have a text file (temperature.txt) that contains registered temperatures for a…
A: Program execution as follows. use ifstream for reading the file read the temperature value…
Q: Create a program that reads three lines from a text file. Each line should be read one at a time.…
A: Please upvote/Like me. please. I am providing you the correct answer below. Please. Please.
Q: Write a function that reads a single line of numbers from a file named "question1.txt", and returns…
A: Algorithm: Step1: Open the text file in read write mode. Step2: Read the line with numbers and split…
Q: Write a program that computes and prints the average of the numbers in a text file. You should make…
A: code :
Q: Write a program that reads the student information from a comma separated values (csv) file. The…
A: Required:
Q: Given a text file containing the availability of food items, write a program that reads the…
A: I have provided PYTHON CODE , TXT FILE screenshot, CODE SCREENSHOT and OUTPUT…
Q: Write a function that reads a text files and writes the same file out but with the lines double…
A:
Q: Exercise 1: Write a Python program that reads from the user the name of two files (an input file and…
A: INPUT######## place the input file in the current folder where program is stored…
Q: Write a function that reads a single line of numbers from a file named "question1.txt", and returns…
A: Given: Write a function that reads a single line of numbers from a file named"question1.txt", and…
Q: Write a c++ program v.cc that allows to read from a file vot.in the last names of the candidates in…
A: the code of the given program is given below:-
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 asks the user for the name of a text file. The program should display the last…
A: Lets see the solution.
Q: Write a program that prompts the user to enter a text file, reads words from the file, and displays…
A: Given: program that prompts the user to enter a text file, reads words from the file, and displays…
Q: Write a program that enters data of 10 bank accounts and write on a file Account.txt file. Account…
A: CODE : #include<stdio.h> #include<string.h> //Structure for Bank Account struct…
Q: 1. Write a program that reads a file consisting of students' test scores in the range 0-200. It…
A: Save the text file with the name of “score” and make sure that its extension should be “.txt”. Save…
Q: Write a program that reads a text and outputs the letters, together with their counts, as explained…
A: The program should have the following functions: Function main – calls all the functions. Function…
Q: Exercise 1: Write a Python program that reads from the user the name of two files (an input file and…
A: input_filename=input("Enter input file name: ") # taking input file nameoutput_filename=input("Enter…
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 asks the user for the name of a text file. The program should display the first…
A: Given: Write a program that asks the user for the name of a text file. The program should display the…
Q: Write a program to open a file named INVENTORY and store in it the following data:
A: #include <stdio.h> int main() { FILE *fptr; char itemNameLabel[10]; char…
Q: Write a program, no need for include header files: Pretend a semaphore is already created named:…
A: Explanation of the program is given in the form of comment. Proving a working answer of the question…
Q: a large corporation with two plants has discovered that some of its employees are on the payrolls of…
A: #include…
Q: Write a program that includes a function that alculates the equation F= x" sin x. Write the alues n,…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Initialize a list…
Q: Write a program that asks the user for the name of a file. The program should display only the first…
A: Program Plan: Create the file variable and prompt the user to input the name of file to be read…
Q: Write a program that reads a file consisting of students’ test scores in the range 0–200.…
A: Step 1 I am using c++ programming language for to execute this program.
Q: Write a program that reads a text and outputs the letters, together with their counts, as explained…
A: Program code: #include <iostream> #include <fstream> using namespace std; // Create a…
Q: Write a program whose main function is merely a collection of variable declarations and function…
A: #include <iostream> #include <fstream> using namespace std; // Create a struct…
Q: Write a program that reads a text file containing synonyms for a word and outputs synonyms that…
A: Answer :
Q: Write a function that reads a single line "question1.txt", and returns the average the file is as…
A: Begin by creating a text file and storing numbers in it. I have named my file question1.txt.…
Q: Write a program that uses a text file to store weekly payroll data for the office. The program…
A: Program plan: Firstly creating a main() function Giving a name to the file for the program Opening…
Q: Exercise 1: Write a Python program that reads from the user the name of two files (an input file and…
A:
Q: Write a program that reads a text and outputs the letters, together with their counts, as explained…
A: Program code: #include <iostream> #include <fstream> using namespace std; // Create a…
Q: Exercise 1: Write a Python program that reads from the user the name of two files (an input file and…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Exercise #3: Write a program that finds all students who score the highest and lowest average marks…
A: for your requirements i have provided the in detail
Q: Write a program whose main function is merely a collection of variable declarations and function…
A: Since the Programming language is not mentioned in the question, we will answer this question in C++…
Q: For this program, assume you have an input file with several lines of text. Each line has a…
A: Code:- import java.io.*; import java.util.Scanner; public class Main { private static final int…
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: Write a program in C++ that will let the user create a text file name NameRecord.txt and allow the…
A: C++ code for the given problem :- #include <iostream>#include<fstream>using namespace…
Q: Write a program that creates the file "LetterGrades.txt" filled with 1000 randomly generated letter…
A: import random def main(): #create variable for file name fileName = 'LetterGrades.txt'…
Q: Given a text file containing the availability of food items, write a program that reads the…
A: Below I have provided Python Programming. Also, I have attached the screenshot of the code and…
Q: Write a program that includes a function that calculates the equation F= x" sin x. Write the values…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Initialize a list…
Q: Exercise 2 Write a Program that reads integers from a file called "input.dat" (Figure 1) that…
A:
Q: Write a function count_character(filename, character) that takes in a filename and a character, both…
A: Below is the code in python and sample output:
Q: Write a program that uses a structure to store the following information on a company division:…
A: Write a program that uses a structure to store the following information on a company division:…
Q: For an e-Shop, there is a Customer whose data is stored in a file ‘Customers.txt’, where ID, Name,…
A: Program approach:- Function to pay. Accessing each row. Checking for required customer-id. Checking…
Write a
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Write a program that reads a text and outputs the letters, together with their counts, as explained below in the function printResults. Your program should not have any global variables. All information should be accessed through the parameters of the functions. Your program should have the at least the following functions: • Function main – calls all the functions • Function openFile – opens the input and ouput files. This program has the file stream declare a refence parameter. An appropriate error message should be displayed if the file does not exist. The program must ask the user for the names of the input and output files. • Function countLetters – counts every of uppercase letters A – Z and lower-case letters from a – z in the text file opened in the function openFile. This information should be stored in an array of structures. Both the array and file identifiers must be passed as parameters. • Function printResults – prints the number of uppercase letters for every occurrence…Write a program that reads a text and outputs the letters, together with their counts, as explained below in the function printResults. Your program should not have any global variables. All information should be accessed through the parameters of the functions. Your program should have the at least the following functions: • Function main – calls all the functions • Function openFile – opens the input and ouput files. This program has the file stream declare a refence parameter. An appropriate error message should be displayed if the file does not exist. The program must ask the user for the names of the input and output files. • Function countLetters – counts every of uppercase letters A – Z and lower-case letters from a – z in the text file opened in the function openFile. This information should be stored in an array of structures. Both the array and file identifiers must be passed as parameters. • Function printResults – prints the number of uppercase letters for every occurrence…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 asks the user for the name of a file. The program should display only the first five lines of the file’s contents. If the file contains less than five lines, it should display the file’s entire contents.Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program should first read the name of the text file from the user. The program then should read the text file, line by line. If a food is available, the program should output the available food item in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character ('\t'). Hints: Use the find() function to find the index of a tab character in each row of the text file. Use the substr() function to extract the text separated by the tab characters. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not…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")
- Create a program that reads three lines from a text file. Each line should be read one at a time. For each word on a line, the user should be asked to specify how many syllables are in that word. The program should then inform the user if the file contains a valid Hiku using the function below: def isHiku (firstLine, secondLine, thirdLine):if (firstLine == 5 and secondLine == 7 and thirdLine == 5): return True return False print("The file contains a Hiku:", isHiku(5,7,5))Note: You must replace the values in the function with the numbers counted by your program.Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. Assume also the last names and first names do not contain whitespaces. The program performs the following tasks: Read the file name of the tsv file from the user. Open the tsv file and read the student information. 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 Compute the average of each exam. Output the last names, first names, exam scores, and letter grades of the…For an e-Shop, there is a Customer whose data is stored in a file ‘Customers.txt’, where ID, Name, Phone, Address, Email and AmountBalance. When the customer buys a product and pays from his AmountBalance, the system checks his balance and deducts if enough amount is there. Otherwise the customer receives a message “You don’t have sufficient Balance in your wallet”. Write python code to create a ‘Customers.txt’ file with at least one customer’s record. Write a function pay(), that takes amount as an input, reads the file and gets AmountBalance, print “Successful Transaction” when payment can be made or a message “You don’t have sufficient Balance in your wallet”. Write a function checkBalance(), that reads the file and gets AmountBalance, prints “Amaount Balance” Write a function recharge(), that takes “Enter Amount you want to recharge”, reads the file and gets AmountBalance, adds the new amount in AmountBalance, update the file and prints “Success”
- Write a function that reads a single line of numbers from a file named "question1.txt", and returns the average of the numbers read. For example, if the file is as follows: question1.txt 1 3 5 -2 4 0 6 -2 -3 then the function must return 12/9 = 1.33333 def file_average()= in pythonWrite a program whose main function is merely a collection of variable declarations and function calls. This program reads a text and outputs the letters, together with their counts, as explained below in the function printResult. (There can be no global variables! All information must be passed in and out of the functions. Use a structure to store the information.) Your program must consist of at least the following functions: Function openFile: Opens the input and output files. You must pass the file streams as parameters (by reference, of course). If the file does not exist, the program should print an appropriate message ("The input file does not exist.") and exit. The program must ask the user for the names of the input and output files. Function count: Counts every occurrence of capital letters A-Z and small letters a-z in the text file opened in the function openFile. This information must go into an array of structures. The array must be passed as a parameter, and the file…Write a program that queries information from three files(given to you). The first file contains the names and telephone numbers of a group of people. The second file contains the names and Social Security numbers of a group of people. The third file contains the names and annual income of a group of people. The groups of people should overlap. Your program should ask the user for a telephone number and then print the name, Social Security number, and annual income, if it can determine that information. Sample run1: Enter the phone number (7 digits, with a dash): 555-1234 555-1234 is associated with Bob Bob's SSN is 000300021 Bob's salary is 55000 Sample run2: Enter the phone number (7 digits, with a dash): 675-4566 Couldn't find a name associated with that number. Sample run3: Enter the phone number (7 digits, with a dash): 000-2345 000-2345 is associated with John John's SSN is 000000004 John's salary is 65000 python language