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, 04.07.2019 18:10
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
question
Engineering, 04.07.2019 18:10
Water at 55c flows across a flat plate whose surface temperature is held constant at 95c. if the temperature gradient at the plate's surface for a given value of x is 18 c/mm, find a) local heat transfer coefficient. b) heat flux
Answers: 3
question
Engineering, 04.07.2019 18:10
Aturning operation is performed with following conditions: rake angle of 12°, a feed of 0.35 mm/rev, and a depth of cut of 1.1 mm. the work piece is aluminum alloy 6061 with t6 heat treatment (a16061-t6). the resultant chip thickness was measured to be 1.0 mm. estimate the cutting force, fc. use shear stress of 207 mpa and coefficient of friction on the tool face of 0.6.
Answers: 1
question
Engineering, 04.07.2019 18:20
An engine runs on the ideal diesel cycle. the cycle has a compression ratio of 20 and a cutoff ratio of 2. the highest temperature in the cycle is 1200 k. if the heat into the system is 300 kj/kg of working fluid and using variable specific heats determine the work produced per mass of working fluid
Answers: 3
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
Geography, 07.12.2019 17:31
question
Mathematics, 07.12.2019 17:31
question
Mathematics, 07.12.2019 17:31
question
Mathematics, 07.12.2019 17:31
Questions on the website: 13722367