Answered step by step
Verified Expert Solution
Link Copied!

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:

image text in transcribed

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 nice

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago