Purchase Solved CIS170 Week 7 Quiz Sample in C#

$3.99

Purchase Solved CIS170 Week 7 Quiz Sample in C Hash

 

1. (TCO 13) Include the _____ namespace in your C# program to enable it to move files from one directory to another. (Points : 3)
System.File.IO
System.IO
System.Streams
System.Linq

2. (TCO 13) Before your C# program attempts to open a file, it should first _____. (Points : 3)
call File.Open() to make sure the file can be opened
call File.Exists() to make sure the file exists
call File.Create() to create the file
call File.Close() to close the file in case it was already open

3. (TCO 13) To make your C# program delete a file called “oldFile.doc” in the current directory, write _____. (Points : 3)
File.Close(“oldFile.doc”);
File.Close(“oldFile.doc”, true);
File.Delete(“oldFile.doc”);
File.Delete(“oldFile.doc”, true);

4. (TCO 13) To print out the time a file called “plans.txt” was created, write _____. (Points : 3)
Console.WriteLine(File.FileInfo(“plans.txt”);
Console.WriteLine(GetFileInfo(“plans.txt”);
Console.WriteLine(GetCreationTime(“plans.txt”);
Console.WriteLine(File.GetCreationTime(“plans.txt”));

5. (TCO 13) The following C# statement will _____.

Directory.Delete(Directory.GetCurrentDirectory());
(Points : 3)
delete the current directory
delete the files in the current directory
first check the permissions of the current directory
throw an exception

6. (TCO 13) The following C# code will print out _____.

DirectoryInfo dir = new
DirectoryInfo(“.”);
foreach (FileInfo
fil in dir.GetFiles(“*.*”))
Console.WriteLine(file.Name);
(Points : 3)
the names of all subdirectories of the current directory
the names of all subdirectories of the root directory
the contents of all files in the root directory
the names of all files in the current directory

7. (TCO 13) Although the _____ class is useful for working with byte-level data, the _____ class facilitates working with data in readable (text) format. (Points : 3)
IO.StreamReader, IOStream
IO.Stream, IO.StreamWriter
System.IO, IO.Text
IO.Text, System.IO

8. (TCO 13) If a C# program tries to move a file that does not exist and no error handling has been included in the code, a _____ will occur. (Points : 3)
compiler error
linker error
logic error
runtime error

9. (TCO 13) In the following code, the statement “StreamWriter myFile = new StreamWriter(“text.txt”, true);” _____.

try
{
StreamWriter myFile = new StreamWriter(“text.txt”,true);
for (int i = 0; i 10; i++)
myFile.WriteLine(“Student[{0}]: “, i);
myFile.Close();
}
(Points : 3)
automatically closes “text.txt” after the try…catch block
won’t create “text.txt” if it doesn’t already exist
opens “text.txt” file for appending
opens “text.txt” file for overwriting

10. (TCO 13) You’re writing a data decryption program. Because your C# code needs to read data from an encrypted file one character at a time, you decide to use the _____ member of the _____ class. (Points : 3)
ReadChar(), BinaryReader
ReadChars(), BinaryReader
ReadChar(), StreamReader
ReadChars(), StreamReader

11. (TCO 13) Write a C# program to write your mother’s first and last names (on the same line) to a new file called “mom.txt.” Use the StreamWriter class and appropriately try…catch blocks. Print out any System.IO.IOExceptions. Remember to close the file after writing to it. (Points: 5)

Want Guide to Quiz?

Get Exam Done gives expert online magnificence assistance to college students withinside the State. Our online magnificence assist carrier covers the entirety from assignments, discussions, and quizzes to tests. We have employed equipped problem specialists to assist our college students. So, whether or not you’re suffering with a challenge or paying someone to take my exam, we’ve got were given your back. Our online magnificence helpers paint day and night time to your mission and deal with all of the troubles you face. Our online magnificence carrier is likewise affordable. Get our online magnificence assist nowadays and kickstart your adventure toward your preferred grades!

Scott Belmont from NYC, USA
Hired a tutor to take programming class and final exam
40 minutes ago
Ebony Nicole from Bronx, USA
Hired a tutor to take history and algebra final exams
2 hours ago
Randy Wells from Texas, USA
Hired an expert to take chemistry proctored exam
1 hour ago
Kurt LeBlanc from Iowa, USA
Hired an expert to take statistics online exam
1 hour ago