(Solved) : Using System Using Static Systemconsole Using Systemio Class Debugfourteen1 Static Void Ma Q42760267 . . .

using System;
using static System.Console;
using System.IO;

class DebugFourteen1
{
static void Main()
{
string fileName;
string directory;
string path;

// Directory.GetFiles return an array of file names. So, anarray should be declared
// correction was done here
string[] files;
int x;
Write(“Enter a directory: “);
directory = ReadLine();

// You have written Directory which was calling the Directoryclass.
// Correction was done here
if (Directory.Exists(directory))
{
files = Directory.GetFiles(directory);

// inside an if clause you check for a condition.
// you have written files.Length=0 which is providing a value
// correction was done here
if (files.Length == 0)
WriteLine(“There are no files in ” + directory);
else
{
WriteLine(directory + ” contains the following files”);
// files.length should always be checked as < and not<=
// correction was done here
for (x = 0; x < files.Length; x++)
WriteLine(” ” + files[x]);
  
Write(“nEnter a file name: “);
fileName = ReadLine();
path = directory + “/” + fileName;
if (File.Exists(path))
{
WriteLine(” File exists and was created ” +File.GetCreationTime(path));
WriteLine(“File was created ” +File.GetCreationTime(fileName));
}
else
WriteLine(” ” + fileName + ” does not exist in the ” + directory, “directory”);
}
}
else
{
WriteLine(“Directory ” + directory + ” does not exist”);
}
}
}

i need help with output

Expert Answer


Answer to using System; using static System.Console; using System.IO; class DebugFourteen1 { static void Main() { string fileName;…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?