Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a file that contains your favorite movie quote. Use atexteditor such as N

ID: 3619395 • Letter: C

Question

Create a file that contains your favorite movie quote. Use atexteditor such as Notepad and save the file as Quote.txt. Copythefile contents and paste them into a word-processing program suchasWord. Save the file as Quote.doc. Write an applicationthatdisplays the sizes of the two files as well as the ratio oftheirsizes to each other. To discover a file's size, you can createaSystem.IO.FileInfo object using a statement such as thefollowing,where FILE_NAME is a string that contains the name ofthefile:
FileInfo wordInfo = new FileInfo(FILE_NAME);
Save the file as FileComparison.cs.

Explanation / Answer

I am just displaying that, How many times the first file is biggerthat the second file. If you have any specific format of output, please let me know, iwill update the code using System; using System.IO; public class Program { static void Main(string[] args) { string txtPath = @"c:Quote.txt"; string docPath = @"c:Quote.doc"; FileInfo txtFI = new FileInfo(txtPath); FileInfo docFI = new FileInfo(docPath); int txtFileSize = 0; int docFileSize = 0; if (txtFI.Exists) { txtFileSize = (int)txtFI.Length; Console.WriteLine("Size of Quote.txt : {0} Bytes",txtFileSize); } if (docFI.Exists) { docFileSize = (int)docPath.Length; Console.WriteLine("Size of Quote.doc : {0}Bytes",docFileSize); } if(docFileSize != 0 || txtFileSize != 0) { float f = (float)txtFileSize / docFileSize; Console.WriteLine("Quote.txt {0} times bigger than Quote.doc",(f-1)); } Console.ReadLine(); } } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote