Perform following operations: 1- Check if a file "data.csv" exists in "resources" folder. 2- If it already exists, delete it and create a new file. (Use try/catch block) 3- Confirm if file is deleted or not. Display a message accordingly.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 10RQ
icon
Related questions
Question
Optional Assignment
Perform following operations:
1- Check if a file "data.csv" exists in "resources" folder.
2- If it already exists, delete it and create a new file. (Use try/catch block)
3- Confirm if file is deleted or not. Display a message accordingly.
3- Store following rows in the newly created file.
Ben, 19, 1984,80000
Cathy,20,1985,75000
4- Save the file.
5- Read the data from the file and print it on the screen.
6- Run the code a couple of times with different data.
Transcribed Image Text:Optional Assignment Perform following operations: 1- Check if a file "data.csv" exists in "resources" folder. 2- If it already exists, delete it and create a new file. (Use try/catch block) 3- Confirm if file is deleted or not. Display a message accordingly. 3- Store following rows in the newly created file. Ben, 19, 1984,80000 Cathy,20,1985,75000 4- Save the file. 5- Read the data from the file and print it on the screen. 6- Run the code a couple of times with different data.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage