Write a complete java program that: asks the user for a filename tests whether the file exists and tells the user if it does exist ask the user whether it should be deleted. Either delete or do not delete the file based on the user input. If they don't delete it, ask them if they would like to write to the file If they want to write, ask what they want to write to the file and write it. Make sure to provide plenty of console output dialog specifying what status/actions are taken at each step.
Write a complete java program that: asks the user for a filename tests whether the file exists and tells the user if it does exist ask the user whether it should be deleted. Either delete or do not delete the file based on the user input. If they don't delete it, ask them if they would like to write to the file If they want to write, ask what they want to write to the file and write it. Make sure to provide plenty of console output dialog specifying what status/actions are taken at each step.
Chapter13: File Input And Output
Section: Chapter Questions
Problem 11RQ
Related questions
Question
PLEASE ASK THE USER IF THEY WOULD LIKE TO WRITE INTO THE FILE IF THEY CHOOSE NOT TO DELETE THE FILE, AND WRITE IT INTO THE FILE USING outputStream
Write a complete java program that:
- asks the user for a filename
- tests whether the file exists and tells the user
- if it does exist ask the user whether it should be deleted.
- Either delete or do not delete the file based on the user input.
- If they don't delete it, ask them if they would like to write to the file
- If they want to write, ask what they want to write to the file and write it.
- if it does exist ask the user whether it should be deleted.
- Make sure to provide plenty of console output dialog specifying what status/actions are taken at each step.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
Knowledge Booster
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.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT