Question: File name vendors _ data and value one _ vendor _ value are read from input. Perform the following tasks: Open the file vendors _
File name vendorsdata and value onevendorvalue are read from input. Perform the following tasks:
Open the file vendorsdata for writing and assign vendorsfile with the opened file.
Write onevendorvalue followed by a newline to vendorsfile, overwriting any existing contents.
Close vendorsfile.
Click here for example
Ex: If the input for vendorsdata is datatxt onevendorvalue is Rob, and:
Contents of file datatxt
Kim
Ina
Abe
then the output comes from:
New contents of file datatxt
Rob
Note: The challenge activity will read and output the file named vendorsdata.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
