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.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 11RQ
icon
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:

  1. asks the user for a filename
  2. tests whether the file exists and tells the user
    1.  if it does exist ask the user whether it should be deleted.
      1.  Either delete or do not delete the file based on the user input.
    2. If they don't delete it, ask them if they would like to write to the file
      1. If they want to write, ask what they want to write to the file and write it. 
  3. Make sure to provide plenty of console output dialog specifying what status/actions are taken at each step.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Constants and Variables
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT