subject

Implement a function called payroll() that takes two string parameters the first of which represents the name of an input file and the second of which represents the name of an output file. The input file contains lines with the following format: hours pay_rate where hours is an integer representing a number of hours worked and pay_rate is a floating point value representing the pay rate per hour. There will be some whitespace between the two values, although you may not make any assumptions about how much or what type. The function reads the input file line by line, computing the total pay (i. e. the product of the hours times the pay_rate -- we are not assuming overtime is computed for any of the values) and writing each amount to a newline in the output file. If the file is empty, the function should not write any numbers to the output file. Note that the strings read from the file will need to be evaluated before you can use them for computations. The following shows what the function would return when called on several sample files found in the zip file containing the assignment. The output files produced are also in the zip file

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
Fast sportcars the top speeds of sportscars, given in miles per hour, are: 155 mph bmw m5 217 mph lamborghini aventador spyder 205 mph ferrari 488 205 mph nissan gtr 197 mph chevrolet corvette stingray zr1 258 mph bugatti veyron supersport 195 mph dodge viper 270 mph hennessey venom 155 mph bmw m3 195 mph mercedes sl given: topspeeds=[155; 217; 205; 205; 197; 258; 195; 270; 155; 195]; carnames=string(["bmw m5" "lamborghini aventador spyder" "ferrari 488" "nissan gtr" "chevrolet corvette stingray zr1" "bugatti veyron supersport" "dodge viper" "hennessey venom" "bmw m3" "mercedes sl"]); the variable is a rectangular array. write a function called selectcars to identify cars with the top speed within a given range, and display the identified names. the selected cars speed will be in a range given by lowerbound < speed < upperbound. inputs to the function selectcars are: a column array os all car top speeds named topspeeds, the corresponding chara
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
The two main ways in which marketers address the competition with their strategies are by satisfying a need better than a competition and by
Answers: 2
question
Computers and Technology, 22.06.2019 21:10
Dameas communication challenge is due to which factor
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
You know the right answer?
Implement a function called payroll() that takes two string parameters the first of which represents...
Questions
question
Mathematics, 16.07.2021 18:30