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
Steel is coated with a thin layer of ceramic to protect against corrosion. what do you expect to happen to the coating when the temperature of the steel is increased significantly? explain.
Answers: 1
question
Engineering, 04.07.2019 18:10
Aloaded platform of total mass 500 kg is supported by a dashpot and by a set of springs of effective stiffness 72 kn/m. it is observed that when the platform is depressed through a distance x = 12.5 cm below its equilibrium position and then released without any initial velocity; it reaches its equilibrium position in the shortest possible time without overshoot. find the position and velocity of the loaded platform 0.10 sec. after its release. if a further load of 400 kg is added to the platform, find, i) the frequency of damped vibrations, and i) the amplitude of vibration after 2 complete oscillations, given that the initial amplitude is 15 cm.
Answers: 1
question
Engineering, 04.07.2019 18:10
During a steady flow process, the change of energy with respect to time is zero. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:10
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
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
Mathematics, 22.10.2019 03:00
question
Mathematics, 22.10.2019 03:00
Questions on the website: 13722361