Answered step by step
Verified Expert Solution
Question
1 Approved Answer
FOR RUBY: This is an exercise in Ruby that addresses: File Input and Output Use Text Files and Folders Topics are taken from the textbook
FOR RUBY:
This is an exercise in Ruby that addresses:
- File Input and Output
- Use Text Files and Folders
Topics are taken from the textbook Ruby Programming by Jerry Lee Ford, Jr. Chapter 9.
---------------------------------------------------
The assignment:
Summary: You are creating a small program that allows the user to create a text document named 'Resolutions, and store that text file in a folder of their choosing. Once the file has been created and stored, allow the user to type in the path for the file, so they can view the contents. The solution should be named FileTest.ro . Include these steps: o Ask the user to input a path and folder name (ex. C: Williams). Check to see if the folder exists. If so, output a message to the user stating "Folder found". If the folder does not exist, create the folder, and output a message to the user stating "Folder created." o Create a file in the user's folder named resolutions.txt. Be sure the file is writable. Have the user type in their resolutions... when they type 'q', the list is done. o Ask the user to type in the path where the resolutions. txt resides. If the file is found, tell the user to hit the enter key to view the contents. If the file cannot be found, notify the user and ask if they would like to try again. o Give them three tries to type in the correct path. Run your program until it works and the output looks niceStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started