74.8k views
3 votes
Your Web page provides a form for users to add their names to a membership list, stored in a text file. You are writing a program to process the form submission. How should your program open the file? Read operations Write operations Append operations This will not work: the form will be used by different people at different times.

1 Answer

5 votes

Answer:

For the above condition, and as mentioned none of the mode will work, and we need to make use of the JSON format. And we nee to use the JavaScript, and we don't need to mention the mode in JavaScript. Thus, this is nowadays used solution for this old problem that existed when we used to code using c++ and c.

Step-by-step explanation:

You need to write over this text file, and you also need to read. Hence, you need to open the file with the three privileges, and the append will be required,and this way we can only move line by line. However, this is an old style. Now we save in text file in JSON format. The data collected from Form is converted to JSON format and written in text file. And as required data can be read or written, and as required. So if we use only JSON format, then we need not mention the mode, as its not required these days in new languages like JavaScript.

User Zgluis
by
5.5k points