Highlights
Phase 1
Write Ruby code and answer following questions. Upload rb files (with comments) on Moodle:
Create a text file named Story1234.txt (1234 should replace by your student ID), type the following statements into the file and save it:
Once upon a time, there was a little boy who went on a great adventure.
Unfortunately, nothing happened.
The End
Next, create a Ruby program named Phase1Q11234.rb (1234 should replace by your student ID) and add the program logic needed to perform the following tasks:
Verify that the file exists.
If the file does not exist, display an error message.
If the file exists, read it and test whether it contains the phrase “a little boy”
If it does display the contents of the text file otherwise display phrase not found.
Add appropriate comments e.g Name, Student ID, functionality of a variable, brief explanation of logic and flow of your program embeded inside the program code.
Create a Ruby program file named Phase1Q21234.rb (1234 should replace by your student ID) and add the program logic needed to perform the following tasks:
Prompt the user to type the path and name of a folder whose contents will be displayed.
Capture and analyze user input to determine whether the specified folder exists.
Tell the user whether or not the folder exists.
If the folder exists, prompt the user to press Enter in order to view the folder’s contents.
If the folder does not exist, display an error message.
Add appropriate comments e.g Name, Student ID, functionality of a variable, brief explanation of logic
Phase 2
Create a Ruby program file named Phase2Q11234.rb (1234 should replace by your student ID) and add the program logic needed to perform the following tasks:
Request two user inputs - a term/word/phrase and a directory from the user through command prompt.
Search for user input term/word/phrase in all text documents (.txt) in the specified directory and sub-directories (user input directory).
Output the list of names of the documents containing the user given term/word/phrase and portion of content of the text document. You can add information like total number of documents containing the term/phrase or total number of occurrence of the term/phrase in a specific document.
Display the appropriate message/information, if there is no match found for the given term/word/phrase in all text documents in the given directory.
Require no fancy user interface. User input will be provided through command prompt .It must implemented by using Ruby.
Implemented by using classes, objects, methods and constructor.
Add appropriate comments e.g Name, Student ID, functionality of a variable, brief explanation of logic
Create a Ruby program file named Phase2Q21234.rb (1234 should replace by your student ID) and add the program logic needed to perform the following tasks:
This phase extends Question 1 by adding the capacity to search term/word/phrase in word documents and pdf documents as well as text documents.
Ruby gems are required to implement Phase 3 installing the gem, using ‘require’ in code and calling the appropriate method of the gem ). Hint: Read the related gem documentation to identify the parameters and output of different methods provided by the gem.
Add appropriate comments e.g Name, Student ID, functionality of a variable, brief explanation of logic
This prototype will then be transported to a rails framework with a user interface similar to the example below.
The user will provide the input through web page in rails. Web page should contain two text fields (1. Word/phrase and 2. Root directory) and a search button in an HTML form.
Search results will be display on web page (same or different) as well.
In this phase for every match found, the filename including the full path will be printed to the browser and a portion of content of the document will be printed into a text-area (these will be added dynamically according to the number of matches found).
This IT Computer Science Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.