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
emmainna [20.7K]
4 years ago
6

In C++ :

Computers and Technology
1 answer:
elena-s [515]4 years ago
8 0

Answer::

//Program is written in C++ Programming Language

// Comments are used for explanatory purpose

#include

#include

#include

#include

using namespace std;

int main(){

ifstream file; // File stream object

string name; // To hold the file name

string inputLine; // To hold a line of input

int lines = 0; // Line counter

int lineNum = 1; // Line number to display

// Get the file name.

cout << "Enter the file name: ";

getline(cin, name);// Open the file.

file.open(name.c_str());// Test for errors.

if (!file){

// There was an error so display an error

// message and end the PROGRAM.

cout << "Error opening " << name << endl;

exit(EXIT_FAILURE);

}

// Read the contents of the file and display

// each line with a line number.

// Get a line from the file.

getline(file, inputLine, '\n');

while (!file.fail()){

// Display the line.

cout << setw(3) << right << lineNum<< ":" << inputLine << endl;

// Update the line DISPLAY COUNTER for the next line.

lineNum++;// Update the total line counter.

lines++;// If we've displayed the 24th line, pause the screen.

if (lines == 24){

cout << "Press ENTER to CONTINUE...";

cin.get();

lines = 0;

}

// Get a line from the file.

getline(file, inputLine, '\n');}

//Close the file.

file.close();

return 0;}

You might be interested in
Describe the role of a distributed file system in a job execution environment such as MapReduce in a large-scale cloud system. g
Bezzdna [24]

Answer:

allows users of physically distributed systems to share their data and resources

Explanation:

The main purpose of the Distributed File System (DFS) is to allows users of physically distributed systems to share their data and resources

6 0
2 years ago
PLEASE PLEASE PLEASE PLEASE help me Im completly lost will give brainliest and 50 points
pav-90 [236]

It can be either a or b.. I suggest go with b

3 0
3 years ago
Read 2 more answers
1. Text that is located between and appears in the browser's
aniked [119]

Answer:

huh?

Explanation:

3 0
3 years ago
What methods do phishing and spoofing scammers use? List and explain methods to protect against phishing and spoofing scams.
Elza [17]

How can you protect against phishing and spoofing scams?

Anti-spyware and firewall settings should be used to prevent phishing attacks and users should update the programs regularly. Firewall protection prevents access to malicious files by blocking the attacks. Antivirus software scans every file which comes through the Internet to your computer.

6 0
3 years ago
A(n)______is a database object used to customiz
Blizzard [7]

Answer:

option B report is the right answer

4 0
3 years ago
Other questions:
  • Technician A says copper has a low resistance. Technician B says the length of wire doesn't affect resistance. Who is correct?
    11·1 answer
  • Which of the following about Java arrays is true?
    14·1 answer
  • If you have a database of books in the library and you would like to find all books published after January 1, 2008, what criter
    7·1 answer
  • When creating a shape in Word, what are some available options? Check all that apply. adding text to the shape changing the size
    6·1 answer
  • Internet is an interconnected networks <br> o true <br> o false
    5·1 answer
  • Weegee confused. <br><br> Why is weegee.org kitty website...?
    8·2 answers
  • What facilitates the automation and management of business processes and controls the movement of work through the business proc
    9·1 answer
  • Computer hardware refers to: Group of answer choices the mechanism through which users interact with a computer. handheld comput
    13·1 answer
  • Is climate change a man-made problem or a natural occurrence ? Why or why not ?
    8·1 answer
  • Use port in a sentence
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!