Write a program to calculate the net pay of an employee. Input the basic pay, pass basic pay to user defined function PayCalculate(), calculate net pay and return to main function. Calculate the net pay of an employee should be stored in a file along with its complete detail such as emp_no, emp_name, emp-designation and next time if u er want to view it can easily view it. H
Q: QUESTION 30 Write a Python function which will find the longest word in a file. The name of the file…
A: Required:
Q: This lab will explore how to define a new C++ data type and also how to combine multiple C++ files…
A: Source Code: 1. printMeFirst.h For copy #include<iostream>using namespace std; void…
Q: Write a program, using functions only, with the following features. 1. Program reads paragraph(s)…
A: Actually, given information is: 1. Program reads paragraph(s) from the file and stores in a…
Q: Use Python for this question: Write a standalone function partyVolume() that takes accepts one…
A: Solution:
Q: Write a C++ program to create a new file named "college.txt" to store list of colleges under Punjab…
A: C++ program to create a new file to store the list of colleges under the Punjab University. The name…
Q: Each line of a hockey file contains a four-digit year, a team name, and a two-digit number of wins.…
A: The text for the code is given below: f = open('hockey.txt')lines = f.readlines()f.close() def…
Q: Write a recursive function, displayFiles , that expects a pathname as an argument. The path name can…
A: Here I written Python code as per problem says. I hope you like it.
Q: 2. Write a complete C program that inputs marks of a student in 5 courses using any loop and writes…
A: The method of designing and developing a computer program that is executable to achieve a particular…
Q: Write a function IN C LANGUAGE that splits the following data read from a file named info.txt and…
A: A file is defined using a stream. The stream is declared using FILE *. The open() function opens a…
Q: Write a Python function that implements binary search. The function takes two parameters – a file…
A: def binary_Search(file, value): #function takes filename and value f = open(file, 'r') #open…
Q: In Python Define a function writeScores with two parameters. The first should be the name of a file,…
A: Following is the python program which defines a function writeScores having two parameters file and…
Q: Write a C function readFile() that will open the StudentInfo.txt file created in last question and…
A: #include<iostream>#include<fstream>using namespace std; // define a class to store…
Q: Use Python for this question: Write a standalone function partyVolume() that takes accepts one…
A: class Volume: def __init__(self, volume): self.volume = volume def up(self, value):…
Q: Q3: For the same program in Q2, write another function that is receives a file stream object for the…
A: Read data from file Have a variable max which is initialized to 0 initially Now iterate over the…
Q: Write a program that includes a function that will find how many times an animal has been sighted.…
A:
Q: Write a complete C++ program that helps a cerkat Muscat Post Office, to do the following tasks: 1…
A: I have written C++ code for the following question:
Q: Write a Python function that implements sequential search. The function takes two parameters - a…
A: def linear_Search(file, value): #function takes filename and searching value f = open(file, 'r')…
Q: In this programming example, there are one function available which is main () class and stored in…
A: Answer :-
Q: 2. Write a complete C program that inputs marks of a student in 5 courses using any loop and writes…
A: The code is given below
Q: In this programming example, there are one function available which is main () class and stored in…
A: Actually, given information: The program should do the following; Show the customer the different…
Q: Write a standalone function partyVolume() in Python that takes accepts one argument, a string…
A: Step 1:- Program Approach:- 1.Create the class Volume with constructor and set, up and down function…
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: Write a program to calculate the net pay of an employee, Input the basic pay, pass basic pay to user…
A: Objective: A program is built to insert the information about employees and calculate the net pay by…
Q: Write a recursive function, displayFiles, that expects a pathname as an argument. The path name can…
A: import os #required method def displayFiles(pathname): #checking if pathname is a file if…
Q: Need help in creating a C(NOT C+ OR C#) function that will help split a string present in a Text…
A: #include <stdio.h>#include <string.h> int main(){ char word[30]; FILE *fp;…
Q: In a file named Exercise2.c write the function double sum(double (*f)(double), int start, int end);…
A: The double is a fundamental data type built into the compiler and used to define numeric variables…
Q: Given matrix A and vector b write a function file that returns f = A*b and a matrix B where B has…
A: Find the java code to do so attached.
Q: This lab will explore how to define a new C++ data type and also how to combine multiple C++ files…
A: Actually, program is an executable software that runs on a computer.
Q: Write a recursive function, displayFiles, that expects a pathname as an argument. The path name can…
A: Program Code to Copy import osdef displayFiles(pathname):#Check if path is a fileif…
Q: Write a function stat(fName) that takes a filename that contains a matrix of numbers. Your function…
A: Algorithm: Start Open the file in read mode and read the content and store it in a variable By…
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: 2. Write a complete C program that inputs marks of a student in 5 courses using any loop and writes…
A: Given: Write a c program to store the values of 5 courses into file and read the values from file…
Q: Write a C++ function (along with helper functions if required) that takes a file stream as a…
A: Write a C++ function (along with helper functions if required) that takes a file stream as a…
Q: This lab will explore how to define a new C++ data type and also how to combine multiple C++ files…
A: Actually, program is an executable software that runs on a computer.
Q: Write a C function willH dle int copyFile (char filenamel, char filename2); Siven the names of a…
A: The function reads characters from the source file and copies into the destination file. If the…
Q: Write a program that creates a function to read multiple DNA sequences from the user and writes them…
A: Python: def convertFileToSequence(filename): clean = -1 # used for determining output # read in file…
Q: 1. Write a function in python to count the number of lines from a text file "story.txt" which is not…
A: Explanation: Given data write a python program to count the number of lines from a text file…
Q: 2. Write a complete C program that inputs marks of a student in 5 courses using any loop and writes…
A: Answer:- Source code #include<stdio.h>char computeGrade(double);int main(){ //create a…
Q: Write a function named take_input() that asks the user for the names (strings) of the owner and the…
A: Step 1: Define function take_input() that opens the file "inventory.txt" in write mode. Step 2:…
Q: Write a function IN C LANGUAGE that splits the following data read from a file named info.txt and…
A: For writing in file, it is easy to write string or int to file using fprintf and putc, but you might…
Q: Write a C program that, 1. writes an n x n matrix into a file named "matrix.txt" the matrix has to…
A: The complete C program is given below with screenshots matrix.txt contents are also attached below
Q: Write a program to calculate the net pay of an employee. Input the basic pay, pass basic pay to…
A: Since programming language not mentioned, using C++ CODE: #include <iostream>using…
Q: Write a C function named int getNumberOfWords( FILE* fp) which finds the number of lines in the…
A: /*Program to find number of lines in the file*/ #include <stdio.h>#define MAX_FILE_NAME 100…
Q: Write a function in C++ program to write a story entered by the user in a file story.txt. Create…
A: The ifstream and ofstream stream objects of c++ programming: The ifstream and ofstream are the…
Q: Write a C++ program to create a new file named “college.txt” to store list of colleges under Punjab…
A: Required: Write a C++ program to create a new file named “college.txt” to store list of colleges…
Q: Write python code to create a ‘Customers.txt’ file with at least one customer’s record. Write a…
A: Program Approach:- importing "CSV" library for CSV functions function to pay opening the…
Q: Modify the following program by use functions fgetc and fputs rather than getchar and puts. The…
A: Note: The question and the code given seems to have no connection. So, I wrote the code for the…
Q: Write a program, using functions only, with the following features. 1. Program reads paragraph(s)…
A: #include <iostream>#include <map> // A map will be used to count the words.#include…
Q: 3. Which of the following is correct for header files? A. Header files are also called as library…
A: Correct options: 3. D 4. D
Write a program to calculate the net pay of an employee. Input the basic pay, pass basic
pay to user defined function PayCalculate(), calculate net pay and return to main function.
Calculate the net pay of an employee should be stored in a file along with its complete
detail such as emp_no, emp_name, emp-designation and next time if u
er want to view it
can easily view it.
H
Step by step
Solved in 2 steps with 1 images
- Write a function void saveByDept(char *fileName, char *deptName , student allStudents[], int size) that will save the information of all students who belong to the department with name pointed to by deptNameinto a text file. The name of the file is given as an input parameter, fileNameWrite a program vote.cc that allows to read from a file vote.in thelast names of the candidates in an election and the number of votes received by eachcandidate. The program should then output each candidate’s name, the number of votesreceived, and the percentage of the total votes received by the candidate. Your programshould also output the winner of the election. Your program should have at least the following functions:(a) Write a function openFile that prompts a user to enter a file name and opens it.(b) Write a function closeFile that closes an open file.(c) Write a function getData that reads from the file the candidate names and theirnumber of votes received and returns them in 2 separate arrays.(d) Write a function sumVote that takes as its parameter an array of number of votesand returns the total number of votes.(e) Write a function computePercentages that takes as its parameters an array ofnumber of votes and returns an array of percentages of votes. Your function shoulduse…Use Python for this question: Write a standalone function partyVolume() that takes accepts one argument, a string containing the name of a file. The objective of the function is to determine the a Volume object that is the result of many people at a party turning the Volume up and down. More specifically: the first line of the file is a number that indicates the initial value of a Volume The remaining lines consist of a single character followed by a space followed by a number. The character will be one of ‘U” or ‘D’ which stand for “up” and “down” respectively. The function will create a new Volume object and then process each line of the file by calling the appropriate method of the Volume object which changes the value of the Volume. The function then returns the final Volume object. Guidelines/hints: This is a standalone function, it should NOT be inside (indented within) the class. It should be listed in the module after the Volume class and without indentation. Note that…
- Use Python for this question: Write a standalone function partyVolume() that takes accepts one argument, a string containing the name of a file. The objective of the function is to determine the a Volume object that is the result of many people at a party turning the Volume up and down. More specifically: the first line of the file is a number that indicates the initial value of a Volume The remaining lines consist of a single character followed by a space followed by a number. The character will be one of ‘U” or ‘D’ which stand for “up” and “down” respectively. The function will create a new Volume object and then process each line of the file by calling the appropriate method of the Volume object which changes the value of the Volume. The function then returns the final Volume object. Guidelines/hints: This is a standalone function, it should NOT be inside (indented within) the class. It should be listed in the module after the Volume class and without indentation. Note that…Write a function count_character(filename, character) that takes in a filename and a character, both as strings, and returns the total number of times the given character occurs in the file. Examples: Contents of hello.txt:HelloHELLOHelloHELLO count_character('hello.txt', 'L') returns 4count_character('hello.txt', 'H') returns 4count_character('hello.txt', 'e') returns 2 Requirements: Please use Python Programming only Show screenshot of your work.Write a C program that, 1. writes an n x n matrix into a file named "matrix.txt" the matrix has to contain the number as it is given in the example, and n has to be given by the user 2. contains a function with the name "averageM", which o input parameters are the main diagonal (in the example: [0,1,3]) o of the matrix and the size of the main diagonal (in the example: 3) o and returns with the average of the numbers in the main diagonal (in the example: 1.33) 1. calls the "averageM" function on the matrix.txt" and displays the result on the screen Instruction for the user: "n=": Example: Input: 3 Output in the file: 001 112 223 Output on the screen: 1.33
- Write a standalone function partyVolume() in Python that takes accepts one argument, a string containing the name of a file. The objective of the function is to determine the a Volume object that is the result of many people at a party turning the Volume up and down. More specifically: the first line of the file is a number that indicates the initial value of a Volume The remaining lines consist of a single character followed by a space followed by a number. The character will be one of ‘U” or ‘D’ which stand for “up” and “down” respectively. The function will create a new Volume object and then process each line of the file by calling the appropriate method of the Volume object which changes the value of the Volume. The function then returns the final Volume object. Guidelines/hints: This is a standalone function, it should NOT be inside (indented within) the class. It should be listed in the module after the Volume class and without indentation. Note that the first line of the…Write a function called max_age(inFile, outFile, breed) for a (python program), that takes three strings as input parameters. The function reads all the data from the inFile (1st input parameter) and writes data to the outFile (2nd input parameter) as described below. Each line in the input file represents a pet record and has the following format. name, breed, age where name and breed are strings, and age is an integer value. Your function must find the oldest pet of a given breed (3rd input parameter) from the inFile and write the following information to the outFile. breed, total records of this breed name of the oldest pet, age of the oldest pet Note that outFile must only have these two lines of information. Suppose, inFile contains the following data: shadow, longhair, 3 poshi, bangal, 5 mikus, longhair, 4 tigger, calico, 9 If you call this function with breed = "longhair", then the following must be written in the outFile: longhair, 2 mikus, 4 Your…Write a function named take_input() that asks the user for the names (strings) of the owner and the company, and the names (strings), unit prices (floats), stock quantities (ints) of at least 3 products, and writes this information in a new text file using the following format. owner_name,company_name product1_name,product1_unitprice,product1_stock product2_name,product2_unitprice,product2_stock product3_name,product3_unitprice,product3_stock The name of this text file can be taken as an input parameter of your function or you can choose to use a pre-determined (fixed) name inside of this function. Your function must use exception handling to handle all possible run-time errors so that this function does not crash. Please enter your name >> Bond Hi Bond, please enter your company name >> Mart 007 Let's set up a sales menu for 'Mart 007'. Enter item 1's name >> Spiked Umbrella Enter item 1's unit price >> 7.25 Enter item 1's quantity >> 5 Enter item…
- Write a C++ function (along with helper functions if required) that takes a file stream as a parameter and prints out the maximum negative number in the given file. Do not need to write the main function. An example: [Example file contents] 4 -2 8 12 -8 9 3Prints: Maximum Negative number -2Each line of a hockey file contains a four-digit year, a team name, and a two-digit number of wins.Here is one such file, hockey.txt:2003maple leafs452020maple leafs351995senators181996maple leafs302000senators482012canadiens48The first line of the file, for example, says that in 2003 (year), the maple leafs (team name) had 45 wins.Write a function that takes an open hockey file and returns a list of tuples,where each tuple refers to a team name and that team's maximum number of wins in any year.Here is a sample call of the function on hockey.txt:>>> teams_and_most_wins(open('hockey.txt'))[('maple leafs', 45), ('senators', 48), ('canadiens', 48)]"""from typing import TextIOdef teams_and_most_wins(f: TextIO) -> list[tuple[str, int]]:'''f is an open hockey file.Each year has 4 digits and each number of wins has 2 digits.Return a list of tuples where each tuple storesa team name and that team's maximum number of wins in any year.Every team should appear in exactly one of the…Write a program, using functions only, with the following features.1. Program reads paragraph(s) from the file and stores in a string.2. Then program counts the occurrence of each word in the paragraph(s) and stores allwords with their number of occurrences.3. If that word has appeared more than one time in whole string, it should store the wordonly once along its total number occurrences.4. The output described in above (int part 3) must be stored in a new file.