subject
Engineering, 21.02.2020 00:34 imello51

Load the pipe-delimited file P. It is organized with 3 fields on each line: firstname|lastname|birthday. Search for the firstname F and lastname L, replacing the birthday with B. Write the file back out in the same pipe-delimited format. Given Code:# Get the filepath from the command lineimport sysP= sys. argv[1]F= sys. argv[2]L= sys. argv[3]B= sys. argv[4]# ## Our Helper functions:## ## Loads the file at filepath# Returns a 2d array with the data#def load2dArrayFromFile(filepath):# Your code goes here:## Searches the 2d array 'records' for firstname, lastname.# Returns the index of the record or -1 if no record exists#def findIndex(records, firstname, lastname):# Your code goes here:# Sets the birthday of the record at the given index# Returns: nothingdef setBirthday(records, index, newBirthday):# Your code goes here: # Convert the 2d array back into a string# Return the text of the 2d arraydef makeTextFrom2dArray(records):# Your code goes here: # ## Our main code body, where we call our functions.# # # Load our records from the file into a 2d arrayrecords= load2dArrayFromFile(P)# Find out which index, if any, has the name we are huntingindexWeAreHunting= findIndex(records, F, L)# Set the birthday record to the one we were passedsetBirthday(records, indexWeAreHunting, B)# Convert the records into a text stringoutput= makeTextFrom2dArray(records)# Your code goes here# write the text string out to the file

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 14:10
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
question
Engineering, 03.07.2019 23:20
Two technicians are discussing the intake air temperature (iat) sensor. technician a says that the computer uses the iat sensor as a backup to the engine coolant temperature (ect) sensor. technician b says that the powertrain control module (pcm) will subtract the calculated amount of fuel if the air measures hot. who is correct
Answers: 3
question
Engineering, 04.07.2019 18:10
The temperature of air decreases as it is compressed by an adiabatic compressor. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:10
Air is to be cooled in the evaporator section of a refrigerator by passing it over a bank of 0.8-cm-outer-diameter and 0.4-m-long tubes inside which the refrigerant is evaporating at -20°c. air approaches the tube bank in the normal direction at 0°c and 1 atm with a mean velocity of 4 m/s. the tubes are arranged in-line with longitudinal and transverse pitches of sl- st 1.5 cm. there are 30 rows in the flow direction with 15 tubes in each row. determine (a) the refrigeration capacity of this system and (b) pressure drop across the tube bank. evaluate the air properties at an assumed mean temperature of -5°c and 1 atm. is this a good assumption?
Answers: 1
You know the right answer?
Load the pipe-delimited file P. It is organized with 3 fields on each line: firstname|lastname|birth...
Questions
question
English, 06.11.2020 01:40
question
English, 06.11.2020 01:40
question
Computers and Technology, 06.11.2020 01:40
Questions on the website: 13722359