1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
fomenos
3 years ago
13

Suppose there is a text file named "datafile.txt with some data in the root directory of your computer". Using your choice of la

nguage, C#, Java, or pseudocode, write code that (i) opens the file in read mode; (ii) displays the file content on the monitor screen; (iii) uses exception handling mechanism; and (iv) safely closes the file. You don't need to write the main() method.
Computers and Technology
1 answer:
aivan3 [116]3 years ago
6 0

Answer:

See explaination for program code

Explanation:

code below

using System;

using System.IO;

namespace ReadAndDisplayFileCOnsole

{

class Program

{

static void Main(string[] args)

{

using (StreamReader reader = new StreamReader("D:\\datafile.txt"))

{

while (true)

{

string line = reader.ReadLine();

if (line == null)

{

break;

}

Console.WriteLine(line);

}

reader.Close();

Console.Read();

}

}

}

}

You might be interested in
Suppose company A wants to develop a program that duplicates the functionality of a programm by company B. Describe how company
kompoz [17]
The design of the software is covered by copy right unless it is open sourced or is a very common interface. They would need to come up with their own design and way of solving the problem to have a solution that was not copyrighted.
5 0
4 years ago
Explain the process of a for loop and how it is used in code
marshall27 [118]

Ex:

FOR Count= 1 TO 50

.......................

Body

......................

NEXT

Next keeps incrementing count by 1

Hope it helps

4 0
3 years ago
30points!!!! Plz answer quickly
stich3 [128]

Answer:

center

Explanation:

that is the focal point

3 0
3 years ago
Read 2 more answers
Juan has performed a search on his inbox and would like to ensure that the results only include those items with
lubasha [3.4K]

Answer:

The Refine command group

Explanation:

8 0
3 years ago
Search engines use _____ to discover documents for indexing and retrieval.
disa [49]
The choices can be found elsewhere and as follows:

<span>a. caches
b. landing pages
c. Web crawlers
d. proxy servers
e. interstitials
</span>
I believe the correct answer is option C. Search engines use web crawlers to discover documents for indexing and retrieval. It is also known as spiders. It <span>is a software that traverses available Web links in an attempt to perform a given task.</span>
4 0
3 years ago
Other questions:
  • What is the lowest layer of the osi model at which wired and wireless transmissions share the same protocols?
    11·1 answer
  • How has information technology made piracy possible?
    6·1 answer
  • Computers are used to store, retrieve, and _____ data. manipulate mechanize memorize operate
    12·1 answer
  • How can an instance variable be used in a class? Explain your answer. (java)
    10·1 answer
  • Who is the father of computer?​
    6·1 answer
  • Why does a print document need a higher raster effect setting ?​
    14·1 answer
  • TIME REMAINING
    9·1 answer
  • The color in a circle is a _____________ data type.
    13·1 answer
  • bailey reads wikis at the beginning of his research project to get his bearings on the topic. he switches to peer-reviewed journ
    10·1 answer
  • Deirdre has a hearing disability. One of her friends advised her to use real-time text or RTT on her phone. In which of these
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!